summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-01-19 17:54:47 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2014-01-19 17:54:47 -0500
commit6acdfc69b785841ac10a324484ddd0208612a213 (patch)
tree7cd010c99bd5d6129dea0cbd41daf41dc6623da3 /gtk2_ardour
parent0dee3813f909748a5443222944698c46a27a45d6 (diff)
parent8b71e40fbd2112807e6ff7631dc8855feab0eed5 (diff)
visibility macros and flush() added to SrcFileSource; merge with master
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/gain_meter.cc9
-rw-r--r--gtk2_ardour/sfdb_ui.cc16
-rw-r--r--gtk2_ardour/sfdb_ui.h3
3 files changed, 24 insertions, 4 deletions
diff --git a/gtk2_ardour/gain_meter.cc b/gtk2_ardour/gain_meter.cc
index edf07a13a5..53dd006224 100644
--- a/gtk2_ardour/gain_meter.cc
+++ b/gtk2_ardour/gain_meter.cc
@@ -98,6 +98,7 @@ GainMeterBase::GainMeterBase (Session* s, bool horizontal, int fader_length, int
gain_display.signal_activate().connect (sigc::mem_fun (*this, &GainMeter::gain_activated));
gain_display.signal_focus_in_event().connect (sigc::mem_fun (*this, &GainMeter::gain_focused), false);
gain_display.signal_focus_out_event().connect (sigc::mem_fun (*this, &GainMeter::gain_focused), false);
+ gain_display.set_alignment(1.0);
peak_display.set_name ("MixerStripPeakDisplay");
set_size_request_to_display_given_text (peak_display, "-80.g", 2, 6); /* note the descender */
@@ -143,8 +144,7 @@ GainMeterBase::GainMeterBase (Session* s, bool horizontal, int fader_length, int
void
GainMeterBase::set_flat_buttons ()
{
-printf("set_flat_butt\n");
-// gain_slider->set_flat_buttons( ARDOUR_UI::config()->get_flat_buttons() );
+// gain_slider->set_flat_buttons( ARDOUR_UI::config()->flat_buttons.get() );
}
GainMeterBase::~GainMeterBase ()
@@ -907,6 +907,11 @@ GainMeter::GainMeter (Session* s, int fader_length)
}
gain_display_box.pack_start (gain_display, true, true);
+ if (peak_display.get_parent()) {
+ peak_display.get_parent()->remove (gain_display);
+ }
+ gain_display_box.pack_start (peak_display, true, true);
+
meter_metric_area.set_name ("AudioTrackMetrics");
meter_metric_area.set_size_request(24, -1);
diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc
index 84065c69b1..90bb0a3dce 100644
--- a/gtk2_ardour/sfdb_ui.cc
+++ b/gtk2_ardour/sfdb_ui.cc
@@ -54,6 +54,7 @@
#include "ardour/source_factory.h"
#include "ardour/session.h"
#include "ardour/session_directory.h"
+#include "ardour/srcfilesource.h"
#include "ardour_ui.h"
#include "editing.h"
@@ -391,8 +392,12 @@ SoundFileBox::audition ()
SourceFactory::createExternal (DataType::AUDIO, *_session,
path, n,
Source::Flag (0), false));
-
- srclist.push_back(afs);
+ if (afs->sample_rate() != _session->nominal_frame_rate()) {
+ boost::shared_ptr<SrcFileSource> sfs (new SrcFileSource(*_session, afs, _src_quality));
+ srclist.push_back(sfs);
+ } else {
+ srclist.push_back(afs);
+ }
} catch (failed_constructor& err) {
error << _("Could not access soundfile: ") << path << endmsg;
@@ -1683,6 +1688,7 @@ SoundFileOmega::SoundFileOmega (string title, ARDOUR::Session* s,
set_popdown_strings (src_combo, str);
src_combo.set_active_text (str.front());
src_combo.set_sensitive (false);
+ src_combo.signal_changed().connect (sigc::mem_fun (*this, &SoundFileOmega::src_combo_changed));
reset_options ();
@@ -1793,6 +1799,12 @@ SoundFileOmega::get_src_quality() const
}
}
+void
+SoundFileOmega::src_combo_changed()
+{
+ preview.set_src_quality(get_src_quality());
+}
+
ImportDisposition
SoundFileOmega::get_channel_disposition () const
{
diff --git a/gtk2_ardour/sfdb_ui.h b/gtk2_ardour/sfdb_ui.h
index ccfd3799be..46408ecffc 100644
--- a/gtk2_ardour/sfdb_ui.h
+++ b/gtk2_ardour/sfdb_ui.h
@@ -70,6 +70,7 @@ class SoundFileBox : public Gtk::VBox, public ARDOUR::SessionHandlePtr, public P
void audition();
bool audition_oneshot();
bool autoplay () const;
+ void set_src_quality(ARDOUR::SrcQuality q) { _src_quality = q; }
protected:
std::string path;
@@ -117,6 +118,7 @@ class SoundFileBox : public Gtk::VBox, public ARDOUR::SessionHandlePtr, public P
bool seek_button_press(GdkEventButton*);
bool seek_button_release(GdkEventButton*);
bool _seeking;
+ ARDOUR::SrcQuality _src_quality;
};
class SoundFileBrowser : public ArdourWindow
@@ -313,6 +315,7 @@ class SoundFileOmega : public SoundFileBrowser
bool reset_options ();
void reset_options_noret ();
bool bad_file_message ();
+ void src_combo_changed ();
void do_something (int action);
};