diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2006-06-20 18:50:38 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2006-06-20 18:50:38 +0000 |
commit | be362ae53c1d191e23d8a084d0327044bce4544c (patch) | |
tree | fb64f8276c64a495a0fdcf99e772d983af7725c0 /gtk2_ardour | |
parent | c03dbd7568322d553ff681cb7f0bbd3452abd6cf (diff) |
fixes for libsndfile conversion issues, tape track waveform display and overloaded virtual functions
git-svn-id: svn://localhost/ardour2/trunk@624 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/SConscript | 42 | ||||
-rw-r--r-- | gtk2_ardour/axis_view.h | 10 | ||||
-rw-r--r-- | gtk2_ardour/canvas-waveview.c | 24 | ||||
-rw-r--r-- | gtk2_ardour/crossfade_view.cc | 9 | ||||
-rw-r--r-- | gtk2_ardour/crossfade_view.h | 1 | ||||
-rw-r--r-- | gtk2_ardour/editor_mouse.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/imageframe_socket_handler.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/imageframe_time_axis_view.cc | 6 | ||||
-rw-r--r-- | gtk2_ardour/imageframe_view.cc | 7 | ||||
-rw-r--r-- | gtk2_ardour/imageframe_view.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/main.cc | 1 | ||||
-rw-r--r-- | gtk2_ardour/mixer_strip.cc | 1 | ||||
-rw-r--r-- | gtk2_ardour/panner2d.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/panner2d.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/redirect_automation_line.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/regionview.cc | 6 | ||||
-rw-r--r-- | gtk2_ardour/regionview.h | 1 | ||||
-rw-r--r-- | gtk2_ardour/selectable.h | 18 | ||||
-rw-r--r-- | gtk2_ardour/streamview.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/time_axis_view_item.cc | 16 | ||||
-rw-r--r-- | gtk2_ardour/time_axis_view_item.h | 18 |
21 files changed, 76 insertions, 98 deletions
diff --git a/gtk2_ardour/SConscript b/gtk2_ardour/SConscript index b670a6d969..99c97d20a4 100644 --- a/gtk2_ardour/SConscript +++ b/gtk2_ardour/SConscript @@ -58,9 +58,6 @@ if gtkardour['FFT_ANALYSIS']: gtkardour.Merge ([libraries['fftw3f']]) gtkardour.Append(CCFLAGS='-DFFT_ANALYSIS') -if gtkardour['VST']: - gtkardour.Merge ([ libraries['fst']]) - skipped_files=Split(""" connection_editor.cc """) @@ -203,15 +200,16 @@ itest.cc """) extra_sources = [] + vst_files = [ 'vst_pluginui.cc' ] if env['VST']: - extra_sources += vst_files - + extra_sources += vst_files + gtkardour.Append (CCFLAGS="-DVST_SUPPORT", CPPPATH="#libs/fst") + if env['FFT_ANALYSIS']: extra_sources += fft_analysis_files - intl_files += extra_sources gtkardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE") @@ -226,6 +224,8 @@ gtkardour.VersionBuild(['version.cc','version.h'], 'SConscript') executable = 'ardour.bin' ardour = gtkardour.Program(target = executable, source = gtkardour_files + extra_sources) +ardourlib = gtkardour.SharedLibrary(target = 'ardourgtk', source = gtkardour_files + extra_sources) + mtest = gtkardour.Program(target = 'mtest', source = mtest_files) itest = gtkardour.Program(target = 'itest', source = itest_files) @@ -235,21 +235,28 @@ my_subst_dict['%INSTALL_PREFIX%'] = install_prefix ardoursh = env.SubstInFile ('ardour.sh','ardour.sh.in', SUBST_DICT = my_subst_dict); env.AddPostAction (ardoursh, Chmod ('$TARGET', 0755)) -Default(ardour) +if env['VST']: + Default(ardourlib) + # the library - into the library dir + env.Alias('install', env.Install(os.path.join(install_prefix, 'lib/ardour2'), ardourlib)) +else: + + if env['VERSIONED']: + Default (env.VersionedExecutable ('tagged_executable', ardour)) + else: + Default(ardour) -if env['VERSIONED']: - Default (env.VersionedExecutable ('tagged_executable', ardour)) + #install + + # the executable - into the library dir + env.Alias('install', env.Install(os.path.join(install_prefix, 'lib/ardour2'), ardour)) + # the script - into the bin dir + env.Alias('install', env.InstallAs(os.path.join(install_prefix, 'bin')+'/ardour2', ardoursh)) if env['NLS']: - Export('gtkardour', 'intl_files') - SConscript ('po/SConscript') + Export('gtkardour', 'intl_files') + SConscript ('po/SConscript') -#install - -# the executable - into the library dir -env.Alias('install', env.Install(os.path.join(install_prefix, 'lib/ardour2'), ardour)) -# the script - into the bin dir -env.Alias('install', env.InstallAs(os.path.join(install_prefix, 'bin')+'/ardour2', ardoursh)) # configuration files env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour2_ui.rc')) env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour.menus')) @@ -259,6 +266,7 @@ env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour env.Alias('install', env.Install(os.path.join(install_prefix, 'share/ardour2'), 'splash.ppm')) env.Alias('install', env.Install(os.path.join(install_prefix, 'share/ardour2/pixmaps'), pixmap_files)) + #dist env.Alias ('tarball', env.Distribute (env['DISTTREE'], [ 'SConscript', diff --git a/gtk2_ardour/axis_view.h b/gtk2_ardour/axis_view.h index 38deece11a..12b7d32188 100644 --- a/gtk2_ardour/axis_view.h +++ b/gtk2_ardour/axis_view.h @@ -28,6 +28,7 @@ #include <pbd/xml++.h> #include "prompter.h" +#include "selectable.h" namespace ARDOUR { class Session; @@ -37,7 +38,7 @@ namespace ARDOUR { * AxisView defines the abstract base class for time-axis trackviews and routes. * */ -class AxisView : public virtual sigc::trackable +class AxisView : public virtual Selectable { public: /** @@ -51,12 +52,6 @@ class AxisView : public virtual sigc::trackable virtual string name() const = 0; - virtual void set_selected (bool yn) { - if (yn != _selected) { - _selected = yn; - } - } - virtual bool marked_for_display() const { return _marked_for_display; } virtual void set_marked_for_display (bool yn) { @@ -65,7 +60,6 @@ class AxisView : public virtual sigc::trackable } } - virtual bool selected() const { return _selected; } sigc::signal<void> Hiding; sigc::signal<void> GoingAway; diff --git a/gtk2_ardour/canvas-waveview.c b/gtk2_ardour/canvas-waveview.c index 34b64770a6..3e4a14d86a 100644 --- a/gtk2_ardour/canvas-waveview.c +++ b/gtk2_ardour/canvas-waveview.c @@ -389,7 +389,11 @@ gnome_canvas_waveview_ensure_cache (GnomeCanvasWaveView *waveview, gulong start_ /* but make sure it doesn't extend beyond the end of the source material */ rf3 = (gulong) (waveview->sourcefile_length_function (waveview->data_src, waveview->samples_per_unit)) + 1; - rf3 -= new_cache_start; + if (rf3 < new_cache_start) { + rf3 = 0; + } else { + rf3 -= new_cache_start; + } #if DEBUG_CACHE fprintf (stderr, "\n\nAVAILABLE FRAMES = %lu of %lu, start = %lu, sstart = %lu, cstart = %lu\n", @@ -405,8 +409,8 @@ gnome_canvas_waveview_ensure_cache (GnomeCanvasWaveView *waveview, gulong start_ #if DEBUG_CACHE fprintf (stderr, "new cache = %lu - %lu\n", new_cache_start, new_cache_end); - fprintf(stderr,"required_cach_entries = %lu, samples_per_unit = %f\n", - required_cache_entries,waveview->samples_per_unit); + fprintf(stderr,"required_cach_entries = %lu, samples_per_unit = %f req frames = %lu\n", + required_cache_entries,waveview->samples_per_unit, required_frames); #endif if (required_cache_entries > cache->allocated) { @@ -514,8 +518,8 @@ gnome_canvas_waveview_ensure_cache (GnomeCanvasWaveView *waveview, gulong start_ // fprintf(stderr,"length == %lu\n",waveview->length_function (waveview->data_src)); // required_frames = MIN (waveview->length_function (waveview->data_src) - new_cache_start, required_frames); + npeaks = (gulong) floor (required_frames / waveview->samples_per_unit); - npeaks = MAX (1, npeaks); required_frames = npeaks * waveview->samples_per_unit; #if DEBUG_CACHE @@ -532,11 +536,15 @@ gnome_canvas_waveview_ensure_cache (GnomeCanvasWaveView *waveview, gulong start_ // start_sample, end_sample); #endif - waveview->peak_function (waveview->data_src, npeaks, new_cache_start, required_frames, cache->data + offset, waveview->channel,waveview->samples_per_unit); - - /* take into account any copied peaks */ + if (required_frames) { + waveview->peak_function (waveview->data_src, npeaks, new_cache_start, required_frames, cache->data + offset, waveview->channel,waveview->samples_per_unit); - npeaks += copied; + /* take into account any copied peaks */ + + npeaks += copied; + } else { + npeaks = copied; + } if (npeaks < cache->allocated) { #if DEBUG_CACHE diff --git a/gtk2_ardour/crossfade_view.cc b/gtk2_ardour/crossfade_view.cc index aef54f2c5d..4545837dfa 100644 --- a/gtk2_ardour/crossfade_view.cc +++ b/gtk2_ardour/crossfade_view.cc @@ -50,7 +50,7 @@ CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent, AudioRegionView& rview) - : TimeAxisViewItem ("xf.name()", *parent, tv, spu, basic_color, xf.position(), + : TimeAxisViewItem ("xfade" /*xf.name()*/, *parent, tv, spu, basic_color, xf.position(), xf.overlap_length(), TimeAxisViewItem::Visibility (TimeAxisViewItem::ShowFrame)), crossfade (xf), left_view (lview), @@ -91,13 +91,6 @@ CrossfadeView::~CrossfadeView () GoingAway (this) ; /* EMIT_SIGNAL */ } -std::string -CrossfadeView::get_item_name () -{ - return "xfade"; -// return crossfade.name(); -} - void CrossfadeView::reset_width_dependent_items (double pixel_width) { diff --git a/gtk2_ardour/crossfade_view.h b/gtk2_ardour/crossfade_view.h index b4931c94c0..403edfe297 100644 --- a/gtk2_ardour/crossfade_view.h +++ b/gtk2_ardour/crossfade_view.h @@ -46,7 +46,6 @@ struct CrossfadeView : public TimeAxisViewItem AudioRegionView& left_view; // and these too AudioRegionView& right_view; - std::string get_item_name(); void set_height (double); bool valid() const { return _valid; } diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 991a1b1443..c140213bb2 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -195,7 +195,7 @@ Editor::set_mouse_mode (MouseMode m, bool force) */ for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ++i) { - if ((*i)->selected()) { + if ((*i)->get_selected()) { (*i)->show_selection (selection->time); } } diff --git a/gtk2_ardour/imageframe_socket_handler.cc b/gtk2_ardour/imageframe_socket_handler.cc index 4f08954a8d..f649eddef7 100644 --- a/gtk2_ardour/imageframe_socket_handler.cc +++ b/gtk2_ardour/imageframe_socket_handler.cc @@ -1091,7 +1091,7 @@ ImageFrameSocketHandler::handle_item_selected(const char* msg) } else { - ifv->set_selected(true, this) ; + ifv->set_selected(true) ; ifta->get_view()->set_selected_imageframe_view(iftag, ifv) ; thePublicEditor.scroll_timeaxis_to_imageframe_item(ifv) ; diff --git a/gtk2_ardour/imageframe_time_axis_view.cc b/gtk2_ardour/imageframe_time_axis_view.cc index e00c399e7f..a725082863 100644 --- a/gtk2_ardour/imageframe_time_axis_view.cc +++ b/gtk2_ardour/imageframe_time_axis_view.cc @@ -365,11 +365,11 @@ ImageFrameTimeAxisView::set_selected_imageframe_view(ImageFrameTimeAxisGroup* if if(selected_imageframe_view) { - selected_imageframe_view->set_selected(false, this) ; + selected_imageframe_view->set_selected(false) ; } selected_imageframe_view = ifv ; - selected_imageframe_view->set_selected(true, this) ; + selected_imageframe_view->set_selected(true) ; } /** @@ -386,7 +386,7 @@ ImageFrameTimeAxisView::clear_selected_imageframe_item(bool clear_group) if(selected_imageframe_view) { - selected_imageframe_view->set_selected(false, this) ; + selected_imageframe_view->set_selected(false) ; } selected_imageframe_view = 0 ; } diff --git a/gtk2_ardour/imageframe_view.cc b/gtk2_ardour/imageframe_view.cc index e8ff878486..ac17a7cc1a 100644 --- a/gtk2_ardour/imageframe_view.cc +++ b/gtk2_ardour/imageframe_view.cc @@ -172,16 +172,15 @@ delete imageframe; * @return true if the position change was a success, false otherwise */ bool -ImageFrameView::set_position(jack_nframes_t pos, void* src) +ImageFrameView::set_position(jack_nframes_t pos, void* src, double* delta) { jack_nframes_t old_pos = frame_position ; // do the standard stuff - bool ret = TimeAxisViewItem::set_position(pos, src) ; + bool ret = TimeAxisViewItem::set_position(pos, src, delta) ; // everything went ok with the standard stuff? - if(ret) - { + if (ret) { /* move each of our associated markers with this ImageFrameView */ for (MarkerViewList::iterator i = marker_view_list.begin(); i != marker_view_list.end(); ++i) { diff --git a/gtk2_ardour/imageframe_view.h b/gtk2_ardour/imageframe_view.h index c599082580..5ae8aaded6 100644 --- a/gtk2_ardour/imageframe_view.h +++ b/gtk2_ardour/imageframe_view.h @@ -91,7 +91,7 @@ class ImageFrameView : public TimeAxisViewItem * @param src the identity of the object that initiated the change * @return true if the position change was a success, false otherwise */ - virtual bool set_position(jack_nframes_t pos, void* src) ; + virtual bool set_position(jack_nframes_t pos, void* src, double* delta = 0) ; /** * Sets the duration of this item diff --git a/gtk2_ardour/main.cc b/gtk2_ardour/main.cc index dc30690611..2bbae39568 100644 --- a/gtk2_ardour/main.cc +++ b/gtk2_ardour/main.cc @@ -361,6 +361,7 @@ To create it from the command line, start ardour as \"ardour --new %1"), path) return true; } + int main (int argc, char *argv[]) { diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index cc66d1128a..3a8881916c 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -125,7 +125,6 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, Route& rt, bool in_mixer) output_button.set_name ("MixerIOButton"); output_label.set_name ("MixerIOButtonLabel"); - _route.meter_change.connect (mem_fun(*this, &MixerStrip::meter_changed)); meter_point_button.add (meter_point_label); meter_point_button.set_name ("MixerStripMeterPreButton"); diff --git a/gtk2_ardour/panner2d.cc b/gtk2_ardour/panner2d.cc index c6b2bad6c9..36f7aab252 100644 --- a/gtk2_ardour/panner2d.cc +++ b/gtk2_ardour/panner2d.cc @@ -127,7 +127,7 @@ Panner2d::reset (uint32_t n_inputs) } void -Panner2d::on_size_allocate (Gtk::Allocation alloc) +Panner2d::on_size_allocate (Gtk::Allocation& alloc) { width = alloc.get_width(); height = alloc.get_height(); diff --git a/gtk2_ardour/panner2d.h b/gtk2_ardour/panner2d.h index ff81ea3987..1bf8879ba5 100644 --- a/gtk2_ardour/panner2d.h +++ b/gtk2_ardour/panner2d.h @@ -78,7 +78,7 @@ class Panner2d : public Gtk::DrawingArea bool on_button_press_event (GdkEventButton *); bool on_button_release_event (GdkEventButton *); bool on_motion_notify_event (GdkEventMotion *); - void on_size_allocate (Gtk::Allocation alloc); + void on_size_allocate (Gtk::Allocation& alloc); private: struct Target { diff --git a/gtk2_ardour/redirect_automation_line.h b/gtk2_ardour/redirect_automation_line.h index 3933359db0..ad39f6625c 100644 --- a/gtk2_ardour/redirect_automation_line.h +++ b/gtk2_ardour/redirect_automation_line.h @@ -53,8 +53,6 @@ class RedirectAutomationLine : public AutomationLine void view_to_model_y (double&); void model_to_view_y (double&); - void change_model (uint32_t, double x, double y); - void change_model_range (uint32_t, uint32_t, double delta); }; #endif /* __ardour_gtk_region_gain_line_h__ */ diff --git a/gtk2_ardour/regionview.cc b/gtk2_ardour/regionview.cc index ad012b3483..4d73b64fe7 100644 --- a/gtk2_ardour/regionview.cc +++ b/gtk2_ardour/regionview.cc @@ -1234,12 +1234,6 @@ AudioRegionView::set_waveform_shape (WaveformShape shape) } } -std::string -AudioRegionView::get_item_name () -{ - return region.name(); -} - void AudioRegionView::move (double x_delta, double y_delta) { diff --git a/gtk2_ardour/regionview.h b/gtk2_ardour/regionview.h index cb71a8f3a7..f49b46aea4 100644 --- a/gtk2_ardour/regionview.h +++ b/gtk2_ardour/regionview.h @@ -63,7 +63,6 @@ class AudioRegionView : public TimeAxisViewItem bool is_valid() const { return valid; } void set_valid (bool yn) { valid = yn; } - std::string get_item_name(); void set_height (double); void set_samples_per_unit (double); bool set_duration (jack_nframes_t, void*); diff --git a/gtk2_ardour/selectable.h b/gtk2_ardour/selectable.h index fdd6f7ff9f..b4be7090e2 100644 --- a/gtk2_ardour/selectable.h +++ b/gtk2_ardour/selectable.h @@ -21,7 +21,9 @@ #ifndef __ardour_gtk_selectable_h__ #define __ardour_gtk_selectable_h__ -class Selectable +#include <sigc++/signal.h> + +class Selectable : public virtual sigc::trackable { public: Selectable() { @@ -30,10 +32,20 @@ class Selectable virtual ~Selectable() {} - virtual void set_selected (bool) { - _selected = true; + virtual void set_selected (bool yn) { + if (yn != _selected) { + _selected = true; + Selected (_selected); /* EMIT_SIGNAL */ + } + } + + bool get_selected() const { + return _selected; } + /** Emitted when the selected status of this Selectable changes */ + sigc::signal<void, bool> Selected ; + protected: bool _selected; }; diff --git a/gtk2_ardour/streamview.cc b/gtk2_ardour/streamview.cc index 70c06b1db7..e95411a498 100644 --- a/gtk2_ardour/streamview.cc +++ b/gtk2_ardour/streamview.cc @@ -548,7 +548,7 @@ StreamView::set_selected_regionviews (AudioRegionSelection& regions) } // cerr << "\tregion " << (*i)->region.name() << " selected = " << selected << endl; - (*i)->set_selected (selected, this); + (*i)->set_selected (selected); } } diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc index f54688ddfb..c333a8acb3 100644 --- a/gtk2_ardour/time_axis_view_item.cc +++ b/gtk2_ardour/time_axis_view_item.cc @@ -484,26 +484,14 @@ TimeAxisViewItem::get_item_name() const * @param src the identity of the object that initiated the change */ void -TimeAxisViewItem::set_selected(bool yn, void* src) +TimeAxisViewItem::set_selected(bool yn) { if (_selected != yn) { - _selected = yn ; + Selectable::set_selected (yn); set_frame_color (); - Selected (_selected) ; /* EMIT_SIGNAL */ } } -/** - * Returns whether this item is currently selected. - * - * @return true if this item is currently selected, false otherwise - */ -bool -TimeAxisViewItem::get_selected() const -{ - return (_selected) ; -} - void TimeAxisViewItem::set_should_show_selection (bool yn) { diff --git a/gtk2_ardour/time_axis_view_item.h b/gtk2_ardour/time_axis_view_item.h index c9e4fd5dd5..b23350eef7 100644 --- a/gtk2_ardour/time_axis_view_item.h +++ b/gtk2_ardour/time_axis_view_item.h @@ -21,8 +21,6 @@ #ifndef __gtk_ardour_time_axis_view_item_h__ #define __gtk_ardour_time_axis_view_item_h__ -#include <sigc++/signal.h> - #include <jack/jack.h> #include <string> @@ -38,7 +36,7 @@ class TimeAxisView; * A base class for 'items' that may appear upon a TimeAxisView * */ -class TimeAxisViewItem : public sigc::trackable, public Selectable +class TimeAxisViewItem : public Selectable { public: virtual ~TimeAxisViewItem() ; @@ -170,9 +168,8 @@ class TimeAxisViewItem : public sigc::trackable, public Selectable * Set to true to indicate that this item is currently selected * * @param yn true if this item is currently selected - * @param src the identity of the object that initiated the change */ - virtual void set_selected(bool yn, void* src) ; + virtual void set_selected(bool yn) ; /** * Set to true to indicate that this item should show its selection status @@ -181,13 +178,6 @@ class TimeAxisViewItem : public sigc::trackable, public Selectable */ virtual void set_should_show_selection (bool yn) ; - /** - * Returns whether this item is currently selected. - * - * @return true if this item is currently selected, false otherwise - */ - bool get_selected() const ; - //---------------------------------------------------------------------------------------// // Parent Component Methods @@ -319,10 +309,6 @@ class TimeAxisViewItem : public sigc::trackable, public Selectable /** Emitted when the mionimum item duration is changed */ sigc::signal<void,jack_nframes_t,void*> MinDurationChanged ; - /** Emitted when the selected status of this item changes */ - sigc::signal<void, bool> Selected ; - - protected: enum Visibility { |