From 03536cd399131e3fec54c95ae5ac6f11dca05aef Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 26 Feb 2009 00:58:35 +0000 Subject: Fix a bunch of warnings. Clean up. git-svn-id: svn://localhost/ardour2/branches/3.0@4668 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/analysis_window.h | 131 +++++++++++++++++------------------ gtk2_ardour/audio_region_view.cc | 3 +- gtk2_ardour/automation_time_axis.cc | 2 +- gtk2_ardour/canvas-note-event.h | 2 +- gtk2_ardour/canvas-waveview.c | 33 ++++----- gtk2_ardour/fft_graph.h | 4 +- gtk2_ardour/fft_result.h | 8 +-- gtk2_ardour/gtk-custom-hruler.c | 4 +- gtk2_ardour/gtk-custom-ruler.c | 1 + gtk2_ardour/midi_channel_selector.cc | 2 +- gtk2_ardour/midi_channel_selector.h | 6 +- gtk2_ardour/midi_region_view.cc | 3 +- gtk2_ardour/panner2d.cc | 2 + gtk2_ardour/plugin_selector.cc | 5 +- gtk2_ardour/region_selection.cc | 41 +++-------- gtk2_ardour/region_view.cc | 6 +- gtk2_ardour/route_time_axis.cc | 2 +- gtk2_ardour/time_axis_view_item.cc | 3 +- 18 files changed, 124 insertions(+), 134 deletions(-) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/analysis_window.h b/gtk2_ardour/analysis_window.h index 45752c4a34..185774225b 100644 --- a/gtk2_ardour/analysis_window.h +++ b/gtk2_ardour/analysis_window.h @@ -45,82 +45,81 @@ class AnalysisWindow : public Gtk::Window { - public: - AnalysisWindow (); - ~AnalysisWindow (); +public: + AnalysisWindow (); + ~AnalysisWindow (); - void set_rangemode(); - void set_regionmode(); - - void track_list_row_changed(const Gtk::TreeModel::Path& path, const Gtk::TreeModel::iterator& iter); + void set_rangemode(); + void set_regionmode(); - void analyze (); + void track_list_row_changed(const Gtk::TreeModel::Path& path, const Gtk::TreeModel::iterator& iter); - const void set_session(ARDOUR::Session *session) { _session = session; }; + void analyze (); - private: - - ARDOUR::Session *_session; + void set_session(ARDOUR::Session *session) { _session = session; }; - void clear_tracklist(); +private: - void source_selection_changed (Gtk::RadioButton *); - void display_model_changed (Gtk::RadioButton *); - void show_minmax_changed (); - void show_normalized_changed (); + ARDOUR::Session *_session; - void analyze_data (Gtk::Button *); - - struct TrackListColumns : public Gtk::TreeModel::ColumnRecord { - public: - TrackListColumns () { - add (trackname); + void clear_tracklist(); + + void source_selection_changed (Gtk::RadioButton *); + void display_model_changed (Gtk::RadioButton *); + void show_minmax_changed (); + void show_normalized_changed (); + + void analyze_data (Gtk::Button *); + + struct TrackListColumns : public Gtk::TreeModel::ColumnRecord { + public: + TrackListColumns () { + add (trackname); add (visible); add (color); add (graph); - } - Gtk::TreeModelColumn trackname; - Gtk::TreeModelColumn visible; - Gtk::TreeModelColumn color; - Gtk::TreeModelColumn graph; - }; - - // Packing essentials - Gtk::HBox hbox; - Gtk::VBox vbox; - - // Left side - Glib::RefPtr tlmodel; - TrackListColumns tlcols; - Gtk::TreeView track_list; - - Gtk::Label source_selection_label; - - - Gtk::RadioButton source_selection_ranges_rb; - Gtk::RadioButton source_selection_regions_rb; - - Gtk::HSeparator hseparator1; - - Gtk::Label display_model_label; - Gtk::RadioButton display_model_composite_separate_rb; - Gtk::RadioButton display_model_composite_all_tracks_rb; - - Gtk::Button refresh_button; - - - Gtk::CheckButton show_minmax_button; - Gtk::CheckButton show_normalized_button; - - - - // The graph - FFTGraph fft_graph; - - bool track_list_ready; - Glib::Mutex track_list_lock; - - friend class FFTGraph; + } + Gtk::TreeModelColumn trackname; + Gtk::TreeModelColumn visible; + Gtk::TreeModelColumn color; + Gtk::TreeModelColumn graph; + }; + + // Packing essentials + Gtk::HBox hbox; + Gtk::VBox vbox; + + // Left side + Glib::RefPtr tlmodel; + TrackListColumns tlcols; + Gtk::TreeView track_list; + + Gtk::Label source_selection_label; + + + Gtk::RadioButton source_selection_ranges_rb; + Gtk::RadioButton source_selection_regions_rb; + + Gtk::HSeparator hseparator1; + + Gtk::Label display_model_label; + Gtk::RadioButton display_model_composite_separate_rb; + Gtk::RadioButton display_model_composite_all_tracks_rb; + + Gtk::Button refresh_button; + + + Gtk::CheckButton show_minmax_button; + Gtk::CheckButton show_normalized_button; + + + // The graph + FFTGraph fft_graph; + + bool track_list_ready; + Glib::Mutex track_list_lock; + + friend class FFTGraph; }; #endif // __ardour_analysis_window_h diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc index 17de6517ac..df44b3a4aa 100644 --- a/gtk2_ardour/audio_region_view.cc +++ b/gtk2_ardour/audio_region_view.cc @@ -99,7 +99,8 @@ AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView AudioRegionView::AudioRegionView (const AudioRegionView& other) - : RegionView (other) + : sigc::trackable(other) + , RegionView (other) , zero_line(0) , fade_in_shape(0) , fade_out_shape(0) diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc index 5d6b48850e..bd0da7caf8 100644 --- a/gtk2_ardour/automation_time_axis.cc +++ b/gtk2_ardour/automation_time_axis.cc @@ -733,7 +733,7 @@ AutomationTimeAxisView::paste_one (AutomationLine& line, nframes_t pos, float ti AutomationSelection::iterator p; boost::shared_ptr alist(line.the_list()); - for (p = selection.lines.begin(); p != selection.lines.end() && nth; ++p, --nth); + for (p = selection.lines.begin(); p != selection.lines.end() && nth; ++p, --nth) {} if (p == selection.lines.end()) { return false; diff --git a/gtk2_ardour/canvas-note-event.h b/gtk2_ardour/canvas-note-event.h index 75747bc288..86f7312d17 100644 --- a/gtk2_ardour/canvas-note-event.h +++ b/gtk2_ardour/canvas-note-event.h @@ -49,7 +49,7 @@ namespace Canvas { * * A newer, better canvas should remove the need for all the ugly here. */ -class CanvasNoteEvent : public sigc::trackable, public InteractiveItem { +class CanvasNoteEvent : virtual public sigc::trackable, public InteractiveItem { public: typedef Evoral::Note NoteType; CanvasNoteEvent( diff --git a/gtk2_ardour/canvas-waveview.c b/gtk2_ardour/canvas-waveview.c index f929b31197..5c67044084 100644 --- a/gtk2_ardour/canvas-waveview.c +++ b/gtk2_ardour/canvas-waveview.c @@ -919,61 +919,62 @@ gnome_canvas_waveview_set_property (GObject *object, } static void -gnome_canvas_waveview_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) +gnome_canvas_waveview_get_property ( + GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) { g_return_if_fail (object != NULL); - g_return_if_fail (GNOME_IS_CANVAS_WAVEVIEW (object)); + g_return_if_fail (GNOME_IS_CANVAS_WAVEVIEW (object)); GnomeCanvasWaveView *waveview = GNOME_CANVAS_WAVEVIEW (object); switch (prop_id) { case PROP_DATA_SRC: - g_value_set_pointer(value, waveview->data_src); + g_value_set_pointer(value, waveview->data_src); break; case PROP_CHANNEL: - g_value_set_uint(value, waveview->channel); + g_value_set_uint(value, waveview->channel); break; case PROP_LENGTH_FUNCTION: - g_value_set_pointer(value, waveview->length_function); + g_value_set_pointer(value, waveview->length_function); break; case PROP_SOURCEFILE_LENGTH_FUNCTION: - g_value_set_pointer(value, waveview->sourcefile_length_function); + g_value_set_pointer(value, waveview->sourcefile_length_function); break; case PROP_PEAK_FUNCTION: - g_value_set_pointer(value, waveview->peak_function); + g_value_set_pointer(value, waveview->peak_function); break; case PROP_GAIN_FUNCTION: - g_value_set_pointer(value, waveview->gain_curve_function); + g_value_set_pointer(value, waveview->gain_curve_function); break; case PROP_GAIN_SRC: - g_value_set_pointer(value, waveview->gain_src); + g_value_set_pointer(value, waveview->gain_src); break; case PROP_CACHE: - g_value_set_pointer(value, waveview->cache); + g_value_set_pointer(value, waveview->cache); break; case PROP_CACHE_UPDATER: - g_value_set_boolean(value, waveview->cache_updater); + g_value_set_boolean(value, waveview->cache_updater); break; case PROP_SAMPLES_PER_UNIT: - g_value_set_double(value, waveview->samples_per_unit); + g_value_set_double(value, waveview->samples_per_unit); break; case PROP_AMPLITUDE_ABOVE_AXIS: - g_value_set_double(value, waveview->amplitude_above_axis); + g_value_set_double(value, waveview->amplitude_above_axis); break; case PROP_X: diff --git a/gtk2_ardour/fft_graph.h b/gtk2_ardour/fft_graph.h index ea91a08ea9..50a2df1fda 100644 --- a/gtk2_ardour/fft_graph.h +++ b/gtk2_ardour/fft_graph.h @@ -54,8 +54,8 @@ class FFTGraph : public Gtk::DrawingArea void on_size_allocate(Gtk::Allocation & alloc); FFTResult *prepareResult(Gdk::Color color, std::string trackname); - const void set_show_minmax (bool v) { _show_minmax = v; redraw(); }; - const void set_show_normalized (bool v) { _show_normalized = v; redraw(); }; + void set_show_minmax (bool v) { _show_minmax = v; redraw(); } + void set_show_normalized (bool v) { _show_normalized = v; redraw(); } private: diff --git a/gtk2_ardour/fft_result.h b/gtk2_ardour/fft_result.h index fa2a569108..2042b2d042 100644 --- a/gtk2_ardour/fft_result.h +++ b/gtk2_ardour/fft_result.h @@ -39,16 +39,16 @@ class FFTResult void analyzeWindow(float *window); void finalize(); - const int length() { return _dataSize; } + int length() const { return _dataSize; } float avgAt(int x); float maxAt(int x); float minAt(int x); - const float minimum() { return _minimum; } - const float maximum() { return _maximum; } + float minimum() const { return _minimum; } + float maximum() const { return _maximum; } - const Gdk::Color get_color() { return _color; } + Gdk::Color get_color() const { return _color; } private: FFTResult(FFTGraph *graph, Gdk::Color color, std::string trackname); diff --git a/gtk2_ardour/gtk-custom-hruler.c b/gtk2_ardour/gtk-custom-hruler.c index f0bbb9152e..1446fb487f 100644 --- a/gtk2_ardour/gtk-custom-hruler.c +++ b/gtk2_ardour/gtk-custom-hruler.c @@ -48,8 +48,7 @@ GType gtk_custom_hruler_get_type (void) { static GType hruler_type = 0; - if (!hruler_type) - { + if (!hruler_type) { static const GTypeInfo hruler_info = { sizeof (GtkCustomHRulerClass), @@ -61,6 +60,7 @@ GType gtk_custom_hruler_get_type (void) sizeof (GtkCustomHRuler), 0, /* n_preallocs */ (GInstanceInitFunc) gtk_custom_hruler_init, + NULL /* value_table */ }; hruler_type = g_type_register_static (gtk_custom_ruler_get_type(), "GtkCustomHRuler", diff --git a/gtk2_ardour/gtk-custom-ruler.c b/gtk2_ardour/gtk-custom-ruler.c index 0e7ceb5875..c795e46201 100644 --- a/gtk2_ardour/gtk-custom-ruler.c +++ b/gtk2_ardour/gtk-custom-ruler.c @@ -89,6 +89,7 @@ GType gtk_custom_ruler_get_type (void) sizeof (GtkCustomRuler), 0, /* n_preallocs */ (GInstanceInitFunc) gtk_custom_ruler_init, + NULL /* value_table */ }; ruler_type = g_type_register_static (GTK_TYPE_WIDGET, "GtkCustomRuler", diff --git a/gtk2_ardour/midi_channel_selector.cc b/gtk2_ardour/midi_channel_selector.cc index 12eea5bb12..030a0608ef 100644 --- a/gtk2_ardour/midi_channel_selector.cc +++ b/gtk2_ardour/midi_channel_selector.cc @@ -181,7 +181,7 @@ MidiMultipleChannelSelector::set_channel_mode(ChannelMode mode, uint16_t mask) } } -const uint16_t +uint16_t MidiMultipleChannelSelector::get_selected_channels() const { uint16_t selected_channels = 0; diff --git a/gtk2_ardour/midi_channel_selector.h b/gtk2_ardour/midi_channel_selector.h index a2b6247c75..f604d0ccd3 100644 --- a/gtk2_ardour/midi_channel_selector.h +++ b/gtk2_ardour/midi_channel_selector.h @@ -53,7 +53,7 @@ class SingleMidiChannelSelector : public MidiChannelSelector public: SingleMidiChannelSelector(uint8_t active_channel = 0); - const uint8_t get_active_channel() const { return _active_channel; } + uint8_t get_active_channel() const { return _active_channel; } sigc::signal channel_selected; @@ -79,8 +79,8 @@ public: * bit 0 represents channel 0 and bit 15 represents channel 15 * */ - const uint16_t get_selected_channels() const; - void set_selected_channels(uint16_t selected_channels); + uint16_t get_selected_channels() const; + void set_selected_channels(uint16_t selected_channels); protected: ARDOUR::ChannelMode _channel_mode; diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 2ea8316b37..4a5c209101 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -105,7 +105,8 @@ MidiRegionView::MidiRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView & MidiRegionView::MidiRegionView (const MidiRegionView& other) - : RegionView (other) + : sigc::trackable(other) + , RegionView (other) , _force_channel(-1) , _last_channel_selection(0xFFFF) , _default_note_length(1.0) diff --git a/gtk2_ardour/panner2d.cc b/gtk2_ardour/panner2d.cc index 7a081101f6..0f4655221e 100644 --- a/gtk2_ardour/panner2d.cc +++ b/gtk2_ardour/panner2d.cc @@ -118,6 +118,8 @@ Panner2d::reset (uint32_t n_inputs) case 2: pucks[0]->set_text ("R"); + assert(existing_pucks >= 0); + // FIXME: Impossible (unsigned) if (existing_pucks < 0) { pucks[0]->x.set_value (0.5f); pucks[1]->y.set_value (0.25f); diff --git a/gtk2_ardour/plugin_selector.cc b/gtk2_ardour/plugin_selector.cc index ac9e785522..9398661d70 100644 --- a/gtk2_ardour/plugin_selector.cc +++ b/gtk2_ardour/plugin_selector.cc @@ -281,7 +281,7 @@ PluginSelector::refiller (const PluginInfoList& plugs, const::std::string& filte newrow[plugin_columns.creator] = creator; - if ((*i)->n_inputs.n_total() < 0) { + if ((*i)->n_inputs.n_total() < 0) { // FIXME: Impossible (unsigned) newrow[plugin_columns.audio_ins] = "various"; newrow[plugin_columns.midi_ins] = "various"; } else { @@ -290,7 +290,8 @@ PluginSelector::refiller (const PluginInfoList& plugs, const::std::string& filte snprintf (buf, sizeof(buf), "%d", (*i)->n_inputs.n_midi()); newrow[plugin_columns.midi_ins] = buf; } - if ((*i)->n_outputs.n_total() < 0) { + + if ((*i)->n_outputs.n_total() < 0) { // FIXME: Impossible (unsigned) newrow[plugin_columns.audio_outs] = "various"; newrow[plugin_columns.midi_outs] = "various"; } else { diff --git a/gtk2_ardour/region_selection.cc b/gtk2_ardour/region_selection.cc index 76dfe33107..ac8a783a41 100644 --- a/gtk2_ardour/region_selection.cc +++ b/gtk2_ardour/region_selection.cc @@ -28,10 +28,8 @@ using namespace ARDOUR; using namespace PBD; using namespace sigc; -/** - * Construct an empty RegionSelection. +/** Construct an empty RegionSelection. */ - RegionSelection::RegionSelection () { RegionView::RegionViewGoingAway.connect (mem_fun(*this, &RegionSelection::remove_it)); @@ -40,12 +38,12 @@ RegionSelection::RegionSelection () _current_end = 0; } -/** - * Copy constructor. +/** Copy constructor. * @param other RegionSelection to copy. */ - RegionSelection::RegionSelection (const RegionSelection& other) + : std::list() + , sigc::trackable(other) { RegionView::RegionViewGoingAway.connect (mem_fun(*this, &RegionSelection::remove_it)); @@ -56,11 +54,9 @@ RegionSelection::RegionSelection (const RegionSelection& other) _current_end = other._current_end; } -/** - * operator= to set a RegionSelection to be the same as another. +/** operator= to set a RegionSelection to be the same as another. * @param other Other RegionSelection. */ - RegionSelection& RegionSelection::operator= (const RegionSelection& other) { @@ -79,10 +75,8 @@ RegionSelection::operator= (const RegionSelection& other) return *this; } -/** - * Empty this RegionSelection. +/** Empty this RegionSelection. */ - void RegionSelection::clear_all() { @@ -96,18 +90,15 @@ RegionSelection::clear_all() * @param rv RegionView. * @return true if this selection contains rv. */ - bool RegionSelection::contains (RegionView* rv) const { return find (begin(), end(), rv) != end(); } -/** - * Add a region to the selection. +/** Add a region to the selection. * @param rv Region to add. * @return false if we already had the region, otherwise true. */ - bool RegionSelection::add (RegionView* rv) { @@ -133,23 +124,19 @@ RegionSelection::add (RegionView* rv) return true; } -/** - * Remove a region from the selection. +/** Remove a region from the selection. * @param rv Region to remove. */ - void RegionSelection::remove_it (RegionView *rv) { remove (rv); } -/** - * Remove a region from the selection. +/** Remove a region from the selection. * @param rv Region to remove. * @return true if the region was in the selection, false if not. */ - bool RegionSelection::remove (RegionView* rv) { @@ -213,11 +200,9 @@ RegionSelection::remove (RegionView* rv) return false; } -/** - * Add a region to the list sorted by layer. +/** Add a region to the list sorted by layer. * @param rv Region to add. */ - void RegionSelection::add_to_layer (RegionView * rv) { @@ -248,7 +233,6 @@ struct RegionSortByTime { * @param foo List which will be filled with the selection's regions * sorted by position. */ - void RegionSelection::by_position (list& foo) const { @@ -281,7 +265,6 @@ struct RegionSortByTrack { * @param List which will be filled with the selection's regions * sorted by track and position. */ - void RegionSelection::by_track (list& foo) const { @@ -299,7 +282,6 @@ RegionSelection::by_track (list& foo) const /** * @param Sort the selection by position and track. */ - void RegionSelection::sort_by_position_and_track () { @@ -311,7 +293,6 @@ RegionSelection::sort_by_position_and_track () * @param tv Track. * @return true if any of the selection's regions are on tv. */ - bool RegionSelection::involves (const TimeAxisView& tv) const { @@ -322,4 +303,4 @@ RegionSelection::involves (const TimeAxisView& tv) const } return false; } - + diff --git a/gtk2_ardour/region_view.cc b/gtk2_ardour/region_view.cc index d307eeaa95..7efde0ddf2 100644 --- a/gtk2_ardour/region_view.cc +++ b/gtk2_ardour/region_view.cc @@ -82,7 +82,8 @@ RegionView::RegionView (ArdourCanvas::Group* parent, } RegionView::RegionView (const RegionView& other) - : TimeAxisViewItem (other) + : sigc::trackable(other) + , TimeAxisViewItem (other) , _time_converter(other._time_converter) { /* derived concrete type will call init () */ @@ -95,7 +96,8 @@ RegionView::RegionView (const RegionView& other) } RegionView::RegionView (const RegionView& other, boost::shared_ptr other_region) - : TimeAxisViewItem (other) + : sigc::trackable(other) + , TimeAxisViewItem (other) , _time_converter(other._time_converter) { /* this is a pseudo-copy constructor used when dragging regions diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index f3f27d5183..b5b8a25d1f 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -1435,7 +1435,7 @@ RouteTimeAxisView::paste (nframes_t pos, float times, Selection& selection, size boost::shared_ptr playlist = get_diskstream()->playlist(); PlaylistSelection::iterator p; - for (p = selection.playlists.begin(); p != selection.playlists.end() && nth; ++p, --nth); + for (p = selection.playlists.begin(); p != selection.playlists.end() && nth; ++p, --nth) {} if (p == selection.playlists.end()) { return false; diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc index 98c8b7cce9..c2078f403d 100644 --- a/gtk2_ardour/time_axis_view_item.cc +++ b/gtk2_ardour/time_axis_view_item.cc @@ -105,7 +105,8 @@ TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group& } TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem& other) - : trackview (other.trackview) + : sigc::trackable(other) + , trackview (other.trackview) { Gdk::Color c; -- cgit v1.2.3