2005-10-27 15:46:27 -04:00
|
|
|
/*
|
2019-08-02 17:26:43 -04:00
|
|
|
* Copyright (C) 2005-2007 Taybin Rutkin <taybin@taybin.com>
|
|
|
|
* Copyright (C) 2006-2017 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
* Copyright (C) 2008-2014 David Robillard <d@drobilla.net>
|
|
|
|
* Copyright (C) 2009-2012 Carl Hetherington <carl@carlh.net>
|
|
|
|
* Copyright (C) 2012-2017 Robin Gareus <robin@gareus.org>
|
|
|
|
* Copyright (C) 2013 Colin Fletcher <colin.m.fletcher@googlemail.com>
|
|
|
|
* Copyright (C) 2015-2017 Tim Mayberry <mojofunk@gmail.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
2005-10-27 15:46:27 -04:00
|
|
|
|
2024-09-25 20:38:59 -04:00
|
|
|
#pragma once
|
2005-10-12 16:06:20 -04:00
|
|
|
|
|
|
|
#include <string>
|
2005-10-12 17:59:45 -04:00
|
|
|
#include <vector>
|
2007-10-11 18:07:47 -04:00
|
|
|
#include <map>
|
2005-10-12 16:06:20 -04:00
|
|
|
|
2005-10-12 23:48:57 -04:00
|
|
|
#include <sigc++/signal.h>
|
|
|
|
|
2012-01-18 13:43:43 -05:00
|
|
|
#include <gtkmm/stock.h>
|
2005-10-12 23:48:57 -04:00
|
|
|
#include <gtkmm/box.h>
|
2005-10-12 17:59:45 -04:00
|
|
|
#include <gtkmm/button.h>
|
2005-10-12 23:48:57 -04:00
|
|
|
#include <gtkmm/checkbutton.h>
|
2007-01-05 14:53:38 -05:00
|
|
|
#include <gtkmm/comboboxtext.h>
|
2005-10-12 17:59:45 -04:00
|
|
|
#include <gtkmm/dialog.h>
|
2005-12-07 17:57:47 -05:00
|
|
|
#include <gtkmm/entry.h>
|
2005-10-12 17:59:45 -04:00
|
|
|
#include <gtkmm/filechooserwidget.h>
|
2005-12-07 17:57:47 -05:00
|
|
|
#include <gtkmm/frame.h>
|
|
|
|
#include <gtkmm/label.h>
|
2014-01-16 18:20:58 -05:00
|
|
|
#include <gtkmm/scale.h>
|
2009-05-13 20:13:27 -04:00
|
|
|
#include <gtkmm/textview.h>
|
2012-01-18 13:43:43 -05:00
|
|
|
#include <gtkmm/table.h>
|
|
|
|
#include <gtkmm/liststore.h>
|
|
|
|
#include <gtkmm/spinbutton.h>
|
|
|
|
#include <gtkmm/notebook.h>
|
|
|
|
|
2005-12-07 17:57:47 -05:00
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "ardour/audiofilesource.h"
|
2009-12-17 13:24:23 -05:00
|
|
|
#include "ardour/session_handle.h"
|
2005-10-12 16:06:20 -04:00
|
|
|
|
2012-12-23 13:25:26 -05:00
|
|
|
#include "ardour_window.h"
|
2006-03-22 12:03:00 -05:00
|
|
|
#include "editing.h"
|
2009-05-13 20:13:27 -04:00
|
|
|
#include "audio_clock.h"
|
2014-12-24 20:07:10 -05:00
|
|
|
#include "instrument_selector.h"
|
2005-12-02 17:12:56 -05:00
|
|
|
|
2007-10-11 18:07:47 -04:00
|
|
|
namespace ARDOUR {
|
|
|
|
class Session;
|
|
|
|
};
|
|
|
|
|
|
|
|
class GainMeter;
|
2012-04-05 17:31:55 -04:00
|
|
|
class Mootcher;
|
2007-10-11 18:07:47 -04:00
|
|
|
|
2014-01-16 18:20:58 -05:00
|
|
|
class SoundFileBox : public Gtk::VBox, public ARDOUR::SessionHandlePtr, public PBD::ScopedConnectionList
|
2005-12-07 17:57:47 -05:00
|
|
|
{
|
2017-07-01 15:11:14 -04:00
|
|
|
public:
|
2007-10-11 18:07:47 -04:00
|
|
|
SoundFileBox (bool persistent);
|
2006-12-01 01:01:30 -05:00
|
|
|
virtual ~SoundFileBox () {};
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2006-12-01 01:01:30 -05:00
|
|
|
void set_session (ARDOUR::Session* s);
|
2010-09-14 12:51:02 -04:00
|
|
|
bool setup_labels (const std::string& filename);
|
2007-10-11 18:07:47 -04:00
|
|
|
|
|
|
|
void audition();
|
|
|
|
bool audition_oneshot();
|
|
|
|
bool autoplay () const;
|
2014-01-18 18:45:08 -05:00
|
|
|
void set_src_quality(ARDOUR::SrcQuality q) { _src_quality = q; }
|
2014-03-09 19:48:48 -04:00
|
|
|
void set_import_position(Editing::ImportPosition p) { _import_position = p; }
|
2005-12-07 17:57:47 -05:00
|
|
|
|
2017-07-01 15:11:14 -04:00
|
|
|
protected:
|
2021-02-24 22:11:06 -05:00
|
|
|
void on_size_request (Gtk::Requisition*);
|
|
|
|
|
2010-09-14 12:51:02 -04:00
|
|
|
std::string path;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2006-12-01 01:01:30 -05:00
|
|
|
ARDOUR::SoundFileInfo sf_info;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2007-10-11 18:07:47 -04:00
|
|
|
Gtk::Table table;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2006-12-01 01:01:30 -05:00
|
|
|
Gtk::Label length;
|
|
|
|
Gtk::Label format;
|
|
|
|
Gtk::Label channels;
|
|
|
|
Gtk::Label samplerate;
|
|
|
|
Gtk::Label timecode;
|
2016-12-16 08:46:13 -05:00
|
|
|
Gtk::Label tempomap;
|
2007-10-11 18:07:47 -04:00
|
|
|
|
|
|
|
Gtk::Label channels_value;
|
|
|
|
Gtk::Label samplerate_value;
|
2016-12-16 08:46:13 -05:00
|
|
|
Gtk::Label tempomap_value;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2007-10-11 18:07:47 -04:00
|
|
|
Gtk::Label format_text;
|
|
|
|
AudioClock length_clock;
|
|
|
|
AudioClock timecode_clock;
|
|
|
|
|
2017-09-18 14:45:56 -04:00
|
|
|
Gtk::Frame border_frame;
|
2007-10-11 18:07:47 -04:00
|
|
|
Gtk::Label preview_label;
|
|
|
|
|
|
|
|
Gtk::TextView tags_entry;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2006-12-01 01:01:30 -05:00
|
|
|
Gtk::VBox main_box;
|
|
|
|
Gtk::VBox path_box;
|
|
|
|
Gtk::HBox bottom_box;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2006-12-01 01:01:30 -05:00
|
|
|
Gtk::Button play_btn;
|
|
|
|
Gtk::Button stop_btn;
|
2007-10-11 18:07:47 -04:00
|
|
|
Gtk::CheckButton autoplay_btn;
|
2006-12-01 01:01:30 -05:00
|
|
|
Gtk::Button apply_btn;
|
2014-01-16 18:20:58 -05:00
|
|
|
Gtk::HScale seek_slider;
|
|
|
|
|
|
|
|
PBD::ScopedConnectionList auditioner_connections;
|
|
|
|
void audition_active(bool);
|
2017-09-18 12:39:17 -04:00
|
|
|
void audition_progress(ARDOUR::samplecnt_t, ARDOUR::samplecnt_t);
|
2007-10-11 18:07:47 -04:00
|
|
|
|
2017-06-12 09:59:11 -04:00
|
|
|
void update_autoplay ();
|
|
|
|
void autoplay_toggled ();
|
|
|
|
|
2006-12-01 01:01:30 -05:00
|
|
|
bool tags_entry_left (GdkEventFocus* event);
|
2007-10-11 18:07:47 -04:00
|
|
|
void tags_changed ();
|
|
|
|
void save_tags (const std::vector<std::string>&);
|
|
|
|
void stop_audition ();
|
2014-01-16 18:20:58 -05:00
|
|
|
bool seek_button_press(GdkEventButton*);
|
|
|
|
bool seek_button_release(GdkEventButton*);
|
|
|
|
bool _seeking;
|
2014-01-18 18:45:08 -05:00
|
|
|
ARDOUR::SrcQuality _src_quality;
|
2014-03-09 19:48:48 -04:00
|
|
|
Editing::ImportPosition _import_position;
|
2005-12-07 17:57:47 -05:00
|
|
|
};
|
|
|
|
|
2012-12-23 13:25:26 -05:00
|
|
|
class SoundFileBrowser : public ArdourWindow
|
2005-10-12 17:59:45 -04:00
|
|
|
{
|
2017-07-01 15:11:14 -04:00
|
|
|
private:
|
2007-10-11 18:07:47 -04:00
|
|
|
class FoundTagColumns : public Gtk::TreeModel::ColumnRecord
|
|
|
|
{
|
2017-07-01 15:11:14 -04:00
|
|
|
public:
|
2010-09-14 12:51:02 -04:00
|
|
|
Gtk::TreeModelColumn<std::string> pathname;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2007-10-11 18:07:47 -04:00
|
|
|
FoundTagColumns() { add(pathname); }
|
|
|
|
};
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2011-11-14 17:04:14 -05:00
|
|
|
class FreesoundColumns : public Gtk::TreeModel::ColumnRecord
|
|
|
|
{
|
2017-07-01 15:11:14 -04:00
|
|
|
public:
|
2011-11-14 17:04:14 -05:00
|
|
|
Gtk::TreeModelColumn<std::string> id;
|
|
|
|
Gtk::TreeModelColumn<std::string> uri;
|
|
|
|
Gtk::TreeModelColumn<std::string> filename;
|
2012-03-09 17:02:48 -05:00
|
|
|
Gtk::TreeModelColumn<std::string> duration;
|
2012-12-21 12:28:44 -05:00
|
|
|
Gtk::TreeModelColumn<std::string> filesize;
|
|
|
|
Gtk::TreeModelColumn<std::string> smplrate;
|
2012-12-21 14:32:19 -05:00
|
|
|
Gtk::TreeModelColumn<std::string> license;
|
2022-05-27 07:09:49 -04:00
|
|
|
Gtk::TreeModelColumn<std::string> tooltip;
|
freesound: update to API v2
Add a new client id & token for Ardour 7, and update to Freesound's API
v2.
Implement OAuth authentication for Freesound downloads, as described at:
https://freesound.org/docs/api/authentication.html#oauth-authentication
Open the Freesound login page in the default browser, so that the user
can log in and get an authorization code, to copy-&-paste from the
browser. Exchange this authorization code for an access token, and use
it in a custom 'Authorization: Bearer $TOKEN' http header.
If logging in to Freesound to download a file fails or is cancelled,
clear the 'downloading' flag for that file in the list so that a
subsequent click on it will try to log in again.
Show login progress in download progress bar, and disable preview if
file hasn't yet been downloaded.
If a download fails for any reason (except the user cancelling it),
report an error in the Log window.
Use curl_free() for pointers returned by curl_easy_escape(), as per the
curl documentation, rather than plain free().
Also, don't use the www. sub-domain of freesound.org: although it
appears to work for most things, it returns an empty document from
https://freesound.org/apiv2/oauth2/access_token/
Remove default empty token value from Mootcher constructor, to make it
explicit when we construct a Mootcher that doesn't require
authorisation, by requiring an empty token parameter in that case.
2022-05-16 13:10:34 -04:00
|
|
|
Gtk::TreeModelColumn<bool> downloading;
|
2012-03-09 17:02:48 -05:00
|
|
|
|
|
|
|
FreesoundColumns() {
|
2015-10-04 14:51:05 -04:00
|
|
|
add(id);
|
|
|
|
add(filename);
|
2012-03-09 17:02:48 -05:00
|
|
|
add(uri);
|
|
|
|
add(duration);
|
2012-12-21 12:28:44 -05:00
|
|
|
add(filesize);
|
|
|
|
add(smplrate);
|
2012-12-21 14:32:19 -05:00
|
|
|
add(license);
|
2022-05-27 07:09:49 -04:00
|
|
|
add(tooltip);
|
freesound: update to API v2
Add a new client id & token for Ardour 7, and update to Freesound's API
v2.
Implement OAuth authentication for Freesound downloads, as described at:
https://freesound.org/docs/api/authentication.html#oauth-authentication
Open the Freesound login page in the default browser, so that the user
can log in and get an authorization code, to copy-&-paste from the
browser. Exchange this authorization code for an access token, and use
it in a custom 'Authorization: Bearer $TOKEN' http header.
If logging in to Freesound to download a file fails or is cancelled,
clear the 'downloading' flag for that file in the list so that a
subsequent click on it will try to log in again.
Show login progress in download progress bar, and disable preview if
file hasn't yet been downloaded.
If a download fails for any reason (except the user cancelling it),
report an error in the Log window.
Use curl_free() for pointers returned by curl_easy_escape(), as per the
curl documentation, rather than plain free().
Also, don't use the www. sub-domain of freesound.org: although it
appears to work for most things, it returns an empty document from
https://freesound.org/apiv2/oauth2/access_token/
Remove default empty token value from Mootcher constructor, to make it
explicit when we construct a Mootcher that doesn't require
authorisation, by requiring an empty token parameter in that case.
2022-05-16 13:10:34 -04:00
|
|
|
add(downloading);
|
2012-03-09 17:02:48 -05:00
|
|
|
}
|
2011-11-14 17:04:14 -05:00
|
|
|
};
|
|
|
|
|
2007-10-11 18:07:47 -04:00
|
|
|
FoundTagColumns found_list_columns;
|
|
|
|
Glib::RefPtr<Gtk::ListStore> found_list;
|
|
|
|
|
2011-11-14 17:04:14 -05:00
|
|
|
FreesoundColumns freesound_list_columns;
|
2008-04-11 10:06:50 -04:00
|
|
|
Glib::RefPtr<Gtk::ListStore> freesound_list;
|
|
|
|
|
2013-03-15 15:59:19 -04:00
|
|
|
Gtk::Button freesound_more_btn;
|
2013-06-14 14:17:24 -04:00
|
|
|
Gtk::Button freesound_similar_btn;
|
2011-11-14 17:04:14 -05:00
|
|
|
|
2013-06-14 14:17:24 -04:00
|
|
|
void handle_freesound_results(std::string theString);
|
2022-05-23 11:26:21 -04:00
|
|
|
std::string freesound_licence_filter();
|
2017-07-01 15:11:14 -04:00
|
|
|
public:
|
2012-12-23 15:34:43 -05:00
|
|
|
SoundFileBrowser (std::string title, ARDOUR::Session* _s, bool persistent);
|
2007-02-01 14:53:58 -05:00
|
|
|
virtual ~SoundFileBrowser ();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2015-09-03 08:13:43 -04:00
|
|
|
int run ();
|
|
|
|
int status () const { return _status; }
|
|
|
|
|
2006-12-01 01:01:30 -05:00
|
|
|
virtual void set_session (ARDOUR::Session*);
|
2010-09-14 12:51:02 -04:00
|
|
|
std::vector<std::string> get_paths ();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2007-10-11 18:07:47 -04:00
|
|
|
void clear_selection ();
|
2006-03-22 12:03:00 -05:00
|
|
|
|
2006-12-01 01:01:30 -05:00
|
|
|
Gtk::FileChooserWidget chooser;
|
2008-04-11 10:06:50 -04:00
|
|
|
|
|
|
|
SoundFileBox preview;
|
|
|
|
|
|
|
|
Gtk::Entry found_entry;
|
|
|
|
Gtk::Button found_search_btn;
|
2007-10-11 18:07:47 -04:00
|
|
|
Gtk::TreeView found_list_view;
|
|
|
|
|
2008-04-11 10:06:50 -04:00
|
|
|
Gtk::Entry freesound_entry;
|
2011-11-14 17:04:14 -05:00
|
|
|
Gtk::ComboBoxText freesound_sort;
|
2022-05-23 11:26:21 -04:00
|
|
|
Gtk::ComboBoxText freesound_licence;
|
2013-03-15 15:59:19 -04:00
|
|
|
|
2008-04-11 10:06:50 -04:00
|
|
|
Gtk::Button freesound_search_btn;
|
|
|
|
Gtk::TreeView freesound_list_view;
|
2013-06-14 14:17:24 -04:00
|
|
|
Gtk::Notebook notebook;
|
2008-04-11 10:06:50 -04:00
|
|
|
|
2011-11-14 17:04:14 -05:00
|
|
|
void freesound_search();
|
2013-06-14 14:17:24 -04:00
|
|
|
void refresh_display(std::string ID, std::string file);
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2017-07-01 15:11:14 -04:00
|
|
|
protected:
|
2007-10-11 18:07:47 -04:00
|
|
|
bool resetting_ourselves;
|
2012-12-21 14:32:21 -05:00
|
|
|
int matches;
|
2015-09-03 08:13:43 -04:00
|
|
|
int _status;
|
|
|
|
bool _done;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2012-05-17 06:58:00 -04:00
|
|
|
Gtk::FileFilter audio_and_midi_filter;
|
2008-02-18 14:45:52 -05:00
|
|
|
Gtk::FileFilter audio_filter;
|
|
|
|
Gtk::FileFilter midi_filter;
|
2008-09-10 11:03:30 -04:00
|
|
|
Gtk::FileFilter custom_filter;
|
2007-05-15 22:21:41 -04:00
|
|
|
Gtk::FileFilter matchall_filter;
|
2007-10-11 18:07:47 -04:00
|
|
|
Gtk::HBox hpacker;
|
2015-09-03 08:13:43 -04:00
|
|
|
Gtk::VBox vpacker;
|
2012-12-23 13:25:26 -05:00
|
|
|
|
2015-09-03 09:10:42 -04:00
|
|
|
Gtk::Button import_button;
|
2007-02-01 14:53:58 -05:00
|
|
|
|
2010-09-14 12:51:02 -04:00
|
|
|
static std::string persistent_folder;
|
2007-02-01 14:53:58 -05:00
|
|
|
|
2007-10-11 18:07:47 -04:00
|
|
|
GainMeter* gm;
|
|
|
|
Gtk::VBox meter_packer;
|
|
|
|
void add_gain_meter ();
|
|
|
|
void remove_gain_meter ();
|
|
|
|
void meter ();
|
|
|
|
void start_metering ();
|
|
|
|
void stop_metering ();
|
|
|
|
sigc::connection metering_connection;
|
|
|
|
|
2006-12-01 01:01:30 -05:00
|
|
|
void update_preview ();
|
2008-04-11 10:06:50 -04:00
|
|
|
|
2007-01-04 23:24:23 -05:00
|
|
|
void found_list_view_selected ();
|
2007-10-11 18:07:47 -04:00
|
|
|
void found_list_view_activated (const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn*);
|
2007-01-04 23:24:23 -05:00
|
|
|
void found_search_clicked ();
|
2007-10-11 18:07:47 -04:00
|
|
|
|
2008-04-11 10:06:50 -04:00
|
|
|
void freesound_list_view_selected ();
|
|
|
|
void freesound_list_view_activated (const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn*);
|
|
|
|
void freesound_search_clicked ();
|
2013-03-15 15:59:19 -04:00
|
|
|
void freesound_more_clicked ();
|
2013-06-14 14:17:24 -04:00
|
|
|
void freesound_similar_clicked ();
|
2022-05-27 07:09:49 -04:00
|
|
|
void freesound_search_params_changed ();
|
2013-03-15 15:59:19 -04:00
|
|
|
int freesound_page;
|
freesound: update to API v2
Add a new client id & token for Ardour 7, and update to Freesound's API
v2.
Implement OAuth authentication for Freesound downloads, as described at:
https://freesound.org/docs/api/authentication.html#oauth-authentication
Open the Freesound login page in the default browser, so that the user
can log in and get an authorization code, to copy-&-paste from the
browser. Exchange this authorization code for an access token, and use
it in a custom 'Authorization: Bearer $TOKEN' http header.
If logging in to Freesound to download a file fails or is cancelled,
clear the 'downloading' flag for that file in the list so that a
subsequent click on it will try to log in again.
Show login progress in download progress bar, and disable preview if
file hasn't yet been downloaded.
If a download fails for any reason (except the user cancelling it),
report an error in the Log window.
Use curl_free() for pointers returned by curl_easy_escape(), as per the
curl documentation, rather than plain free().
Also, don't use the www. sub-domain of freesound.org: although it
appears to work for most things, it returns an empty document from
https://freesound.org/apiv2/oauth2/access_token/
Remove default empty token value from Mootcher constructor, to make it
explicit when we construct a Mootcher that doesn't require
authorisation, by requiring an empty token parameter in that case.
2022-05-16 13:10:34 -04:00
|
|
|
std::string freesound_token; // keep oauth token while ardour is running
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2007-10-11 18:07:47 -04:00
|
|
|
void chooser_file_activated ();
|
2013-06-14 14:17:24 -04:00
|
|
|
std::string freesound_get_audio_file(Gtk::TreeIter iter);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-02-18 14:45:52 -05:00
|
|
|
bool on_audio_filter (const Gtk::FileFilter::Info& filter_info);
|
|
|
|
bool on_midi_filter (const Gtk::FileFilter::Info& filter_info);
|
2012-05-17 06:58:00 -04:00
|
|
|
bool on_audio_and_midi_filter (const Gtk::FileFilter::Info& filter_info);
|
2007-10-11 18:07:47 -04:00
|
|
|
|
2015-09-03 08:13:43 -04:00
|
|
|
void set_action_sensitive (bool);
|
2017-06-12 08:52:11 -04:00
|
|
|
bool get_action_sensitive () const;
|
2012-12-23 13:39:19 -05:00
|
|
|
|
2015-09-03 08:13:43 -04:00
|
|
|
virtual bool reset_options () { return true; }
|
2007-10-11 18:07:47 -04:00
|
|
|
|
|
|
|
void on_show();
|
2017-06-02 12:21:31 -04:00
|
|
|
bool on_key_press_event (GdkEventKey*);
|
2015-09-03 08:13:43 -04:00
|
|
|
virtual void do_something(int action);
|
2022-09-09 18:55:28 -04:00
|
|
|
|
|
|
|
enum SortOrder {
|
|
|
|
SelectionOrder,
|
|
|
|
FileName,
|
|
|
|
FileMtime
|
|
|
|
};
|
|
|
|
|
|
|
|
virtual SortOrder sort_order () const {
|
|
|
|
return SelectionOrder;
|
|
|
|
}
|
2005-10-12 17:59:45 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
class SoundFileChooser : public SoundFileBrowser
|
2005-10-12 16:06:20 -04:00
|
|
|
{
|
2017-07-01 15:11:14 -04:00
|
|
|
public:
|
2012-12-23 15:34:43 -05:00
|
|
|
SoundFileChooser (std::string title, ARDOUR::Session* _s = 0);
|
2006-12-01 01:01:30 -05:00
|
|
|
virtual ~SoundFileChooser () {};
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2010-09-14 12:51:02 -04:00
|
|
|
std::string get_filename ();
|
2007-10-11 18:07:47 -04:00
|
|
|
|
2017-07-01 15:11:14 -04:00
|
|
|
protected:
|
2007-10-11 18:07:47 -04:00
|
|
|
void on_hide();
|
2005-10-12 16:06:20 -04:00
|
|
|
};
|
|
|
|
|
2005-10-12 23:48:57 -04:00
|
|
|
class SoundFileOmega : public SoundFileBrowser
|
2005-10-12 17:59:45 -04:00
|
|
|
{
|
2017-07-01 15:11:14 -04:00
|
|
|
public:
|
|
|
|
SoundFileOmega (std::string title,
|
|
|
|
ARDOUR::Session* _s,
|
|
|
|
uint32_t selected_audio_tracks,
|
|
|
|
uint32_t selected_midi_tracks,
|
|
|
|
bool persistent,
|
|
|
|
Editing::ImportMode mode_hint = Editing::ImportAsTrack);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2011-07-26 13:22:10 -04:00
|
|
|
void reset (uint32_t selected_audio_tracks, uint32_t selected_midi_tracks);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2007-10-11 18:07:47 -04:00
|
|
|
Gtk::ComboBoxText action_combo;
|
2022-09-09 19:07:17 -04:00
|
|
|
Gtk::ComboBoxText sort_combo;
|
2007-10-11 18:07:47 -04:00
|
|
|
Gtk::ComboBoxText where_combo;
|
|
|
|
Gtk::ComboBoxText channel_combo;
|
|
|
|
Gtk::ComboBoxText src_combo;
|
2016-12-14 07:31:16 -05:00
|
|
|
Gtk::ComboBoxText midi_track_name_combo;
|
2014-12-24 20:07:10 -05:00
|
|
|
InstrumentSelector instrument_combo;
|
2007-10-11 18:07:47 -04:00
|
|
|
|
|
|
|
Gtk::CheckButton copy_files_btn;
|
2016-12-16 09:14:08 -05:00
|
|
|
Gtk::CheckButton smf_tempo_btn;
|
2021-05-07 16:57:41 -04:00
|
|
|
Gtk::CheckButton smf_marker_btn;
|
2007-10-11 18:07:47 -04:00
|
|
|
|
2006-12-01 01:01:30 -05:00
|
|
|
void set_mode (Editing::ImportMode);
|
2007-10-11 18:07:47 -04:00
|
|
|
Editing::ImportMode get_mode() const;
|
2016-12-14 07:31:16 -05:00
|
|
|
ARDOUR::MidiTrackNameSource get_midi_track_name_source () const;
|
2016-12-16 09:14:08 -05:00
|
|
|
bool get_use_smf_tempo_map () const;
|
2021-05-07 16:57:41 -04:00
|
|
|
bool get_use_smf_markers () const;
|
2007-10-11 18:07:47 -04:00
|
|
|
Editing::ImportPosition get_position() const;
|
|
|
|
Editing::ImportDisposition get_channel_disposition() const;
|
|
|
|
ARDOUR::SrcQuality get_src_quality() const;
|
2005-10-12 17:59:45 -04:00
|
|
|
|
2017-07-01 15:11:14 -04:00
|
|
|
protected:
|
2007-10-11 18:07:47 -04:00
|
|
|
void on_hide();
|
2022-09-09 19:07:17 -04:00
|
|
|
virtual SortOrder sort_order () const;
|
2007-10-11 18:07:47 -04:00
|
|
|
|
2017-07-01 15:11:14 -04:00
|
|
|
private:
|
2011-07-26 13:22:10 -04:00
|
|
|
uint32_t selected_audio_track_cnt;
|
|
|
|
uint32_t selected_midi_track_cnt;
|
2007-10-11 18:07:47 -04:00
|
|
|
|
2010-09-14 12:51:02 -04:00
|
|
|
typedef std::map<std::string,Editing::ImportDisposition> DispositionMap;
|
2007-10-11 18:07:47 -04:00
|
|
|
DispositionMap disposition_map;
|
|
|
|
|
2016-07-10 08:08:24 -04:00
|
|
|
Gtk::Table options;
|
2007-10-11 18:07:47 -04:00
|
|
|
|
2010-09-14 12:51:02 -04:00
|
|
|
bool check_info (const std::vector<std::string>& paths,
|
2019-12-06 12:11:19 -05:00
|
|
|
bool& same_size, bool& src_needed, bool& multichannel, bool& must_copy);
|
2007-10-11 18:07:47 -04:00
|
|
|
|
2010-09-14 12:51:02 -04:00
|
|
|
static bool check_link_status (const ARDOUR::Session*, const std::vector<std::string>& paths);
|
2007-10-11 18:07:47 -04:00
|
|
|
|
2019-02-01 11:17:48 -05:00
|
|
|
void instrument_combo_changed ();
|
|
|
|
|
2007-10-11 18:07:47 -04:00
|
|
|
void file_selection_changed ();
|
|
|
|
bool reset_options ();
|
|
|
|
void reset_options_noret ();
|
|
|
|
bool bad_file_message ();
|
2014-01-18 18:45:08 -05:00
|
|
|
void src_combo_changed ();
|
2014-03-09 19:48:48 -04:00
|
|
|
void where_combo_changed ();
|
2012-12-23 13:25:26 -05:00
|
|
|
|
2015-09-03 08:13:43 -04:00
|
|
|
void do_something (int action);
|
2015-12-07 18:28:45 -05:00
|
|
|
|
|
|
|
bool _import_active;
|
|
|
|
bool _reset_post_import;
|
2005-10-12 23:48:57 -04:00
|
|
|
};
|
2005-10-12 17:59:45 -04:00
|
|
|
|