add (*vb2);
- // delete_event.connect (mem_fun(*this, &ArdourDialog::wm_close_event));
+ // signal_delete_event().connect (mem_fun(*this, &ArdourDialog::wm_close_event));
ok_button.signal_clicked().connect (bind (mem_fun(*this, &ArdourDialog::stop), 0));
cancel_button.signal_clicked().connect (bind (mem_fun(*this, &ArdourDialog::stop), 1));
}
Gtk::CheckMenuItem *locations_dialog_check;
Gtk::CheckMenuItem *big_clock_check;
Gtk::CheckMenuItem *tempo_editor_check;
-// Gtk::CheckMenuItem *sfdb_check;
+ Gtk::CheckMenuItem *sfdb_check;
Gtk::CheckMenuItem *options_window_check;
/* <CMT Additions> */
AddRouteDialog *add_route_dialog;
void add_route_dialog_done (int status);
+
+ /* SoundFile Browser */
+ void toggle_sound_file_browser ();
/* Keyboard Handling */
#include <ardour/session.h>
#include "ardour_ui.h"
-#include "mixer_ui.h"
-#include "meter_bridge.h"
#include "connection_editor.h"
-#include "public_editor.h"
-#include "option_editor.h"
#include "location_ui.h"
+#include "meter_bridge.h"
+#include "mixer_ui.h"
+#include "option_editor.h"
+#include "public_editor.h"
#include "route_params_ui.h"
+#include "sfdb_ui.h"
#include "i18n.h"
{
route_params_check->set_active (false);
}
+
+void
+ARDOUR_UI::toggle_sound_file_browser ()
+{
+ if (sfdb_check->get_active()) {
+ SoundFileBrowser sfdb(_("Sound File Browser"));
+
+ sfdb_check->signal_toggled().connect (bind (mem_fun (sfdb, &Gtk::Dialog::response), Gtk::RESPONSE_CANCEL));
+ sfdb.run();
+ sfdb_check->set_active(false);
+ }
+}
+
register_action (common_actions, X_("GotoEditor"), _("Editor"), mem_fun(*this, &ARDOUR_UI::goto_editor_window));
register_action (common_actions, X_("GotoMixer"), _("Mixer"), mem_fun(*this, &ARDOUR_UI::goto_mixer_window));
+ register_toggle_action (common_actions, X_("ToggleSoundFileBrowser"), _("Sound File Browser"), mem_fun(*this, &ARDOUR_UI::toggle_sound_file_browser));
register_toggle_action (common_actions, X_("ToggleOptionsEditor"), _("Options Editor"), mem_fun(*this, &ARDOUR_UI::toggle_options_window));
register_toggle_action (common_actions, X_("ToggleAudioLibrary"), _("Audio Library"), mem_fun(*this, &ARDOUR_UI::toggle_sfdb_window));
act = register_toggle_action (common_actions, X_("ToggleInspector"), _("Track/Bus Inspector"), mem_fun(*this, &ARDOUR_UI::toggle_route_params_window));
str = _("Import selected to region list");
}
- SoundFileChooser sfdb (str, true, true);
+ SoundFileOmega sfdb (str);
+ sfdb.Imported.connect (bind (mem_fun (*this, &Editor::do_import), as_tracks));
- int result = sfdb.run();
-
- if (result == Gtk::RESULT_ACCEPTED) {
- do_import(sfdb.get_filenames, sfdb.get_split(), as_tracks);
- }
+ sfdb.run();
}
void
return;
}
- SoundFileSelector sfdb (_("Add to External Region list"), true, true);
+ SoundFileOmega sfdb (_("Add to External Region list"));
+ sfdb.Embedded.connect (mem_fun (*this, &Editor::do_embed_sndfiles));
- int result = sfdb.run ();
+ sfdb.run ();
}
void
void
Editor::insert_sndfile (bool as_tracks)
{
- SoundFileSelector& sfdb (ARDOUR_UI::instance()->get_sfdb_window());
+// SoundFileSelector& sfdb (ARDOUR_UI::instance()->get_sfdb_window());
sigc::connection c;
string str;
if (as_tracks) {
- c = sfdb.Action.connect (mem_fun(*this, &Editor::insert_paths_as_new_tracks));
+// c = sfdb.Action.connect (mem_fun(*this, &Editor::insert_paths_as_new_tracks));
str = _("Insert selected as new tracks");
} else {
return;
}
- c = sfdb.Action.connect (bind (mem_fun(*this, &Editor::do_insert_sndfile), pos));
+// c = sfdb.Action.connect (bind (mem_fun(*this, &Editor::do_insert_sndfile), pos));
str = _("Insert selected");
}
- sfdb.run (str, false);
- c.disconnect ();
+// sfdb.run (str, false);
+// c.disconnect ();
}
void
void
OptionEditor::click_browse_clicked ()
{
- SoundFileChooser sfdb (_("Choose Click"), false, false);
+ SoundFileChooser sfdb (_("Choose Click"));
int result = sfdb.run ();
- if (result != Gtk::RESPONSE_ACCEPT) {
- return;
+ if (result == Gtk::RESPONSE_OK) {
+ click_chosen(sfdb.get_filename());
}
-
- click_chosen(sfdb.get_filename());
}
void
void
OptionEditor::click_emphasis_browse_clicked ()
{
- SoundFileChooser sfdb (_("Click Emphasis"), false, false);
+ SoundFileChooser sfdb (_("Choose Click Emphasis"));
int result = sfdb.run ();
- if (result != Gtk::RESPONSE_ACCEPT) {
- return;
+ if (result == Gtk::RESPONSE_OK) {
+ click_emphasis_chosen (sfdb.get_filename());
}
-
- click_emphasis_chosen (sfdb.get_filename());
}
void
+#include <gtkmm/box.h>
+#include <gtkmm/stock.h>
+
+#include <ardour/audio_library.h>
+
#include "sfdb_ui.h"
#include "i18n.h"
+SoundFileBrowser::SoundFileBrowser (std::string title)
+ :
+ Gtk::Dialog(title, false),
+ chooser(Gtk::FILE_CHOOSER_ACTION_OPEN)
+{
+ get_vbox()->pack_start(chooser);
+}
+
+SoundFileChooser::SoundFileChooser (std::string title)
+ :
+ SoundFileBrowser(title)
+{
+ add_button (Gtk::Stock::OPEN, Gtk::RESPONSE_OK);
+ add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
+}
+
+SoundFileOmega::SoundFileOmega (std::string title)
+ :
+ SoundFileBrowser(title),
+ embed_btn (_("Embed")),
+ import_btn (_("Import")),
+ split_check (_("Split Channels"))
+{
+ get_action_area()->pack_start(embed_btn);
+ get_action_area()->pack_start(import_btn);
+ add_button (Gtk::Stock::CLOSE, Gtk::RESPONSE_CLOSE);
+
+ chooser.set_extra_widget(split_check);
+
+ embed_btn.signal_clicked().connect (mem_fun (*this, &SoundFileOmega::embed_clicked));
+ import_btn.signal_clicked().connect (mem_fun (*this, &SoundFileOmega::import_clicked));
+}
+
+void
+SoundFileOmega::embed_clicked ()
+{
+ Embedded (chooser.get_filenames(), split_check.get_active());
+}
+
+void
+SoundFileOmega::import_clicked ()
+{
+ Imported (chooser.get_filenames(), split_check.get_active());
+}
+
#include <string>
#include <vector>
+#include <sigc++/signal.h>
+
+#include <gtkmm/box.h>
#include <gtkmm/button.h>
+#include <gtkmm/checkbutton.h>
#include <gtkmm/dialog.h>
#include <gtkmm/filechooserwidget.h>
{
public:
SoundFileBrowser (std::string title);
- virtual ~SoundFileBrowser ();
+ virtual ~SoundFileBrowser () {}
protected:
- Gtk::FileChooserWidget* chooser;
-
- Gtk::Button* ok_btn;
+ Gtk::FileChooserWidget chooser;
};
class SoundFileChooser : public SoundFileBrowser
{
public:
SoundFileChooser (std::string title);
- virtual ~SoundFileChooser ();
-
- std::string get_filename ();
+ virtual ~SoundFileChooser () {};
- protected:
- Gtk::Button* open_btn;
+ std::string get_filename () {return chooser.get_filename();};
};
-class SoundFileOmega : public SoundFileChooser
+class SoundFileOmega : public SoundFileBrowser
{
public:
SoundFileOmega (std::string title);
- virtual ~SoundFileOmega ();
+ virtual ~SoundFileOmega () {};
- std::vector<std::string> get_filenames();
- bool get_split();
+ sigc::signal<void, std::vector<std::string>, bool> Embedded;
+ sigc::signal<void, std::vector<std::string>, bool> Imported;
protected:
- Gtk::Button* insert_btn;
- Gtk::Button* import_btn;
-}
+ Gtk::Button embed_btn;
+ Gtk::Button import_btn;
+ Gtk::CheckButton split_check;
+
+ void embed_clicked ();
+ void import_clicked ();
+};
#endif // __ardour_sfdb_ui_h__