From c67a576d611759154976ee19b8faf78583474f97 Mon Sep 17 00:00:00 2001 From: Taybin Rutkin Date: Sun, 7 May 2006 17:17:38 +0000 Subject: [PATCH] Improved sfdb API. Eliminated some warnings on Darwin. Added libxslt to scons. git-svn-id: svn://localhost/trunk/ardour2@494 d708f5d6-7413-0410-9779-e7cbd77b26cf --- SConstruct | 3 +++ gtk2_ardour/SConscript | 1 + gtk2_ardour/ardour_ui_dialogs.cc | 3 +-- gtk2_ardour/editor_audio_import.cc | 3 +-- gtk2_ardour/option_editor.cc | 6 ++---- gtk2_ardour/panner_ui.cc | 4 ++++ gtk2_ardour/sfdb_ui.cc | 12 +++++++----- gtk2_ardour/sfdb_ui.h | 6 +++--- libs/ardour/SConscript | 1 + libs/ardour/externalsource.cc | 4 ++++ 10 files changed, 27 insertions(+), 16 deletions(-) diff --git a/SConstruct b/SConstruct index be96ad0699..807643df6e 100644 --- a/SConstruct +++ b/SConstruct @@ -373,6 +373,9 @@ libraries['jack'].ParseConfig('pkg-config --cflags --libs jack') libraries['xml'] = LibraryInfo() libraries['xml'].ParseConfig('pkg-config --cflags --libs libxml-2.0') +libraries['xslt'] = LibraryInfo() +libraries['xslt'].ParseConfig('pkg-config --cflags --libs libxslt') + libraries['glib2'] = LibraryInfo() libraries['glib2'].ParseConfig ('pkg-config --cflags --libs glib-2.0') libraries['glib2'].ParseConfig ('pkg-config --cflags --libs gobject-2.0') diff --git a/gtk2_ardour/SConscript b/gtk2_ardour/SConscript index e490778476..32b94f2e4c 100644 --- a/gtk2_ardour/SConscript +++ b/gtk2_ardour/SConscript @@ -42,6 +42,7 @@ gtkardour.Merge ([ libraries['sigc2'], libraries['gtk2'], libraries['xml'], + libraries['xslt'], libraries['soundtouch'], libraries['samplerate'], libraries['jack'], diff --git a/gtk2_ardour/ardour_ui_dialogs.cc b/gtk2_ardour/ardour_ui_dialogs.cc index 1c270ef38d..6b1d0224db 100644 --- a/gtk2_ardour/ardour_ui_dialogs.cc +++ b/gtk2_ardour/ardour_ui_dialogs.cc @@ -356,8 +356,7 @@ int ARDOUR_UI::create_sound_file_browser () { if (sfdb == 0) { - sfdb = new SoundFileBrowser (_("Sound File Browser")); - sfdb->set_session (session); + sfdb = new SoundFileBrowser (_("Sound File Browser"), session); sfdb->signal_unmap().connect (sigc::bind(sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("/Common/ToggleSoundFileBrowser"))); } return 0; diff --git a/gtk2_ardour/editor_audio_import.cc b/gtk2_ardour/editor_audio_import.cc index ddb3bedbb4..184c1757f2 100644 --- a/gtk2_ardour/editor_audio_import.cc +++ b/gtk2_ardour/editor_audio_import.cc @@ -74,8 +74,7 @@ Editor::bring_in_external_audio (ImportMode mode, AudioTrack* track, jack_nframe return; } - SoundFileOmega sfdb (_("Add existing audio to session")); - sfdb.set_session (session); + SoundFileOmega sfdb (_("Add existing audio to session"), session); sfdb.set_mode (mode); switch (sfdb.run()) { diff --git a/gtk2_ardour/option_editor.cc b/gtk2_ardour/option_editor.cc index b50b71f143..5ac4bf5a8d 100644 --- a/gtk2_ardour/option_editor.cc +++ b/gtk2_ardour/option_editor.cc @@ -666,8 +666,7 @@ OptionEditor::raid_path_changed () void OptionEditor::click_browse_clicked () { - SoundFileChooser sfdb (_("Choose Click")); - sfdb.set_session (session); + SoundFileChooser sfdb (_("Choose Click"), session); int result = sfdb.run (); @@ -686,8 +685,7 @@ OptionEditor::click_chosen (const string & path) void OptionEditor::click_emphasis_browse_clicked () { - SoundFileChooser sfdb (_("Choose Click Emphasis")); - sfdb.set_session (session); + SoundFileChooser sfdb (_("Choose Click Emphasis"), session); int result = sfdb.run (); diff --git a/gtk2_ardour/panner_ui.cc b/gtk2_ardour/panner_ui.cc index 64cf7782c1..4b954c0e62 100644 --- a/gtk2_ardour/panner_ui.cc +++ b/gtk2_ardour/panner_ui.cc @@ -293,7 +293,11 @@ PannerUI::setup_pan () bc->StopGesture.connect (bind (mem_fun (_io, &IO::end_pan_touch), (uint32_t) asz)); char buf[64]; +#ifdef __APPLE__ + snprintf (buf, sizeof (buf), _("panner for channel %lu"), asz + 1); +#else snprintf (buf, sizeof (buf), _("panner for channel %u"), asz + 1); +#endif ARDOUR_UI::instance()->tooltips().set_tip (bc->event_widget(), buf); bc->event_widget().signal_button_release_event().connect diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc index 839f78598f..a8b2510cf5 100644 --- a/gtk2_ardour/sfdb_ui.cc +++ b/gtk2_ardour/sfdb_ui.cc @@ -287,7 +287,7 @@ SoundFileBox::field_selected () } } -SoundFileBrowser::SoundFileBrowser (string title) +SoundFileBrowser::SoundFileBrowser (string title, ARDOUR::Session* s) : ArdourDialog (title, false), chooser (Gtk::FILE_CHOOSER_ACTION_OPEN) { @@ -296,6 +296,8 @@ SoundFileBrowser::SoundFileBrowser (string title) chooser.set_select_multiple (true); chooser.signal_update_preview().connect(mem_fun(*this, &SoundFileBrowser::update_preview)); + + set_session (s); } void @@ -310,9 +312,9 @@ SoundFileBrowser::update_preview () chooser.set_preview_widget_active(preview.setup_labels(chooser.get_filename())); } -SoundFileChooser::SoundFileChooser (string title) +SoundFileChooser::SoundFileChooser (string title, ARDOUR::Session* s) : - SoundFileBrowser(title) + SoundFileBrowser(title, s) { add_button (Gtk::Stock::OPEN, Gtk::RESPONSE_OK); add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); @@ -328,8 +330,8 @@ static const char *import_mode_strings[] = { vector SoundFileOmega::mode_strings; -SoundFileOmega::SoundFileOmega (string title) - : SoundFileBrowser (title), +SoundFileOmega::SoundFileOmega (string title, ARDOUR::Session* s) + : SoundFileBrowser (title, s), split_check (_("Split Channels")) { if (mode_strings.empty()) { diff --git a/gtk2_ardour/sfdb_ui.h b/gtk2_ardour/sfdb_ui.h index 79537b2adb..769e4ff02d 100644 --- a/gtk2_ardour/sfdb_ui.h +++ b/gtk2_ardour/sfdb_ui.h @@ -109,7 +109,7 @@ class SoundFileBox : public Gtk::VBox class SoundFileBrowser : public ArdourDialog { public: - SoundFileBrowser (std::string title); + SoundFileBrowser (std::string title, ARDOUR::Session* _s = 0); virtual ~SoundFileBrowser () {}; virtual void set_session (ARDOUR::Session*); @@ -124,7 +124,7 @@ class SoundFileBrowser : public ArdourDialog class SoundFileChooser : public SoundFileBrowser { public: - SoundFileChooser (std::string title); + SoundFileChooser (std::string title, ARDOUR::Session* _s = 0); virtual ~SoundFileChooser () {}; std::string get_filename () {return chooser.get_filename();}; @@ -133,7 +133,7 @@ class SoundFileChooser : public SoundFileBrowser class SoundFileOmega : public SoundFileBrowser { public: - SoundFileOmega (std::string title); + SoundFileOmega (std::string title, ARDOUR::Session* _s); virtual ~SoundFileOmega () {}; /* these are returned by the Dialog::run() method. note diff --git a/libs/ardour/SConscript b/libs/ardour/SConscript index 80cd36750e..9bbd9bc270 100644 --- a/libs/ardour/SConscript +++ b/libs/ardour/SConscript @@ -184,6 +184,7 @@ ardour.Merge ([ libraries['pbd3'], libraries['soundtouch'], libraries['midi++2'], + libraries['xslt'], ]) diff --git a/libs/ardour/externalsource.cc b/libs/ardour/externalsource.cc index 4fb102a4a0..7f478b6f53 100644 --- a/libs/ardour/externalsource.cc +++ b/libs/ardour/externalsource.cc @@ -76,7 +76,11 @@ ExternalSource::peak_path (string audio_path) stat (mp.c_str(), &stat_mount); char buf[32]; +#ifdef __APPLE__ + snprintf (buf, sizeof (buf), "%u-%u-%d.peak", stat_mount.st_ino, stat_file.st_ino, channel); +#else snprintf (buf, sizeof (buf), "%ld-%ld-%d.peak", stat_mount.st_ino, stat_file.st_ino, channel); +#endif string res = peak_dir; res += buf; -- 2.30.2