13
0

Fix a bunch of warnings.

Clean up.


git-svn-id: svn://localhost/ardour2/branches/3.0@4668 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2009-02-26 00:58:35 +00:00
parent 3bc71af0ca
commit 03536cd399
28 changed files with 165 additions and 173 deletions

View File

@ -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<std::string> trackname;
Gtk::TreeModelColumn<bool> visible;
Gtk::TreeModelColumn<Gdk::Color> color;
Gtk::TreeModelColumn<FFTResult *> graph;
};
}
Gtk::TreeModelColumn<std::string> trackname;
Gtk::TreeModelColumn<bool> visible;
Gtk::TreeModelColumn<Gdk::Color> color;
Gtk::TreeModelColumn<FFTResult *> graph;
};
// Packing essentials
Gtk::HBox hbox;
Gtk::VBox vbox;
// Left side
Glib::RefPtr<Gtk::ListStore> tlmodel;
TrackListColumns tlcols;
Gtk::TreeView track_list;
Gtk::Label source_selection_label;
// Packing essentials
Gtk::HBox hbox;
Gtk::VBox vbox;
// Left side
Glib::RefPtr<Gtk::ListStore> 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::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::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;
Gtk::CheckButton show_minmax_button;
Gtk::CheckButton show_normalized_button;
// The graph
FFTGraph fft_graph;
bool track_list_ready;
Glib::Mutex track_list_lock;
// The graph
FFTGraph fft_graph;
friend class FFTGraph;
bool track_list_ready;
Glib::Mutex track_list_lock;
friend class FFTGraph;
};
#endif // __ardour_analysis_window_h

View File

@ -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)

View File

@ -733,7 +733,7 @@ AutomationTimeAxisView::paste_one (AutomationLine& line, nframes_t pos, float ti
AutomationSelection::iterator p;
boost::shared_ptr<AutomationList> 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;

View File

@ -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<double> NoteType;
CanvasNoteEvent(

View File

@ -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:

View File

@ -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:

View File

@ -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);

View File

@ -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",

View File

@ -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",

View File

@ -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;

View File

@ -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<void, uint8_t> 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;

View File

@ -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)

View File

@ -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);

View File

@ -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 {

View File

@ -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<RegionView*>()
, 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<RegionView*>& 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<RegionView*>& foo) const
{
@ -299,7 +282,6 @@ RegionSelection::by_track (list<RegionView*>& 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;
}

View File

@ -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<Region> other_region)
: TimeAxisViewItem (other)
: sigc::trackable(other)
, TimeAxisViewItem (other)
, _time_converter(other._time_converter)
{
/* this is a pseudo-copy constructor used when dragging regions

View File

@ -1435,7 +1435,7 @@ RouteTimeAxisView::paste (nframes_t pos, float times, Selection& selection, size
boost::shared_ptr<Playlist> 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;

View File

@ -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;

View File

@ -21,7 +21,6 @@
#define __ardour_plugin_h__
#include <boost/shared_ptr.hpp>
#include <boost/utility.hpp>
#include <sigc++/signal.h>
#include <glibmm/ustring.h>
@ -88,7 +87,7 @@ class PluginInfo {
typedef boost::shared_ptr<PluginInfo> PluginInfoPtr;
typedef std::list<PluginInfoPtr> PluginInfoList;
class Plugin : public PBD::StatefulDestructible, public Latent, public boost::noncopyable
class Plugin : public PBD::StatefulDestructible, public Latent
{
public:
Plugin (ARDOUR::AudioEngine&, ARDOUR::Session&);
@ -194,14 +193,16 @@ class Plugin : public PBD::StatefulDestructible, public Latent, public boost::no
protected:
friend class PluginInsert;
friend struct PluginInsert::PluginControl;
virtual void set_parameter (uint32_t which, float val) = 0;
bool save_preset (string uri, string domain /* vst, ladspa etc. */);
ARDOUR::AudioEngine& _engine;
ARDOUR::Session& _session;
PluginInfoPtr _info;
uint32_t _cycles;
map<string,PresetRecord> presets;
bool save_preset(string uri, string domain /* vst, ladspa etc. */);
ARDOUR::AudioEngine& _engine;
ARDOUR::Session& _session;
PluginInfoPtr _info;
uint32_t _cycles;
map<string,PresetRecord> presets;
};
PluginPtr find_plugin(ARDOUR::Session&, string unique_id, ARDOUR::PluginType);

View File

@ -90,7 +90,7 @@ class MetricSection {
virtual ~MetricSection() {}
const BBT_Time& start() const { return _start; }
const nframes_t frame() const { return _frame; }
nframes_t frame() const { return _frame; }
void set_movable (bool yn) { _movable = yn; }
bool movable() const { return _movable; }

View File

@ -160,24 +160,24 @@ ExportFormatSpecification::Time::set_state (const XMLNode & node)
return 0;
}
ExportFormatSpecification::ExportFormatSpecification (Session & s) :
session (s),
has_sample_format (false),
supports_tagging (false),
_has_broadcast_info (false),
_channel_limit (0),
_dither_type (D_None),
_src_quality (SRC_SincBest),
_tag (true),
_trim_beginning (false),
_silence_beginning (s),
_trim_end (false),
_silence_end (s),
_normalize (false),
_normalize_target (1.0)
ExportFormatSpecification::ExportFormatSpecification (Session & s)
: session (s)
, has_sample_format (false)
, supports_tagging (false)
, _has_broadcast_info (false)
, _channel_limit (0)
, _dither_type (D_None)
, _src_quality (SRC_SincBest)
, _tag (true)
, _trim_beginning (false)
, _silence_beginning (s)
, _trim_end (false)
, _silence_end (s)
, _normalize (false)
, _normalize_target (1.0)
{
format_ids.insert (F_None);
endiannesses.insert (E_FileDefault);
@ -186,10 +186,10 @@ ExportFormatSpecification::ExportFormatSpecification (Session & s) :
qualities.insert (Q_None);
}
ExportFormatSpecification::ExportFormatSpecification (Session & s, XMLNode const & state) :
session (s),
_silence_beginning (s),
_silence_end (s)
ExportFormatSpecification::ExportFormatSpecification (Session & s, XMLNode const & state)
: session (s)
, _silence_beginning (s)
, _silence_end (s)
{
_silence_beginning.type = Time::SMPTE;
_silence_end.type = Time::SMPTE;
@ -197,10 +197,11 @@ ExportFormatSpecification::ExportFormatSpecification (Session & s, XMLNode const
set_state (state);
}
ExportFormatSpecification::ExportFormatSpecification (ExportFormatSpecification const & other) :
session (other.session),
_silence_beginning (other.session),
_silence_end (other.session)
ExportFormatSpecification::ExportFormatSpecification (ExportFormatSpecification const & other)
: ExportFormatBase(other)
, session (other.session)
, _silence_beginning (other.session)
, _silence_end (other.session)
{
set_name (other.name() + " (copy)");

View File

@ -182,11 +182,7 @@ SampleRateConverter::process (float * data, nframes_t frames)
nframes_t frames_written = piped_to->write (data_out, frames_out);
if (frames_written < 0) {
return frames_written;
} else {
frames_out_total += frames_written;
}
frames_out_total += frames_written;
} while (leftover_frames > frames_in);

View File

@ -1633,7 +1633,7 @@ IO::find_possible_bundle (const string &desired_name, const string &default_name
// find highest set bit
mask = 1;
while ((mask <= bundle_number) && (mask <<= 1));
while ((mask <= bundle_number) && (mask <<= 1)) {}
// "wrap" bundle number into largest possible power of 2
// that works...

View File

@ -131,8 +131,7 @@ MidiPort::flush_buffers (nframes_t nframes, nframes_t offset)
for (MidiBuffer::iterator i = _buffer->begin(); i != _buffer->end(); ++i) {
const Evoral::Event<nframes_t>& ev = *i;
// event times should be frames, relative to cycle start
assert(ev.time() >= 0);
// event times are in frames, relative to cycle start
assert(ev.time() < (nframes+offset));
if (ev.time() >= offset) {
jack_midi_event_write (jack_buffer, (jack_nframes_t) ev.time(), ev.buffer(), ev.size());

View File

@ -897,7 +897,7 @@ void
Panner::remove (uint32_t which)
{
vector<StreamPanner*>::iterator i;
for (i = _streampanners.begin(); i != _streampanners.end() && which; ++i, --which);
for (i = _streampanners.begin(); i != _streampanners.end() && which; ++i, --which) {}
if (i != _streampanners.end()) {
delete *i;

View File

@ -58,12 +58,18 @@ using namespace ARDOUR;
using namespace PBD;
Plugin::Plugin (AudioEngine& e, Session& s)
: _engine (e), _session (s)
: _engine (e)
, _session (s)
, _cycles (0)
{
}
Plugin::Plugin (const Plugin& other)
: _engine (other._engine), _session (other._session), _info (other._info)
: _engine (other._engine)
, _session (other._session)
, _info (other._info)
, _cycles (0)
, presets (other.presets)
{
}

View File

@ -279,7 +279,6 @@ SMFSource::append_event_unlocked_frames (const Evoral::Event<nframes_t>& ev, sfr
name().c_str(), ev.time(), ev.size());
for (size_t i=0; i < ev.size(); ++i) printf("%X ", ev.buffer()[i]); printf("\n");*/
assert(ev.time() >= 0);
if (ev.time() < _last_ev_time_frames) {
cerr << "SMFSource: Warning: Skipping event with non-monotonic time" << endl;
return;

View File

@ -341,7 +341,7 @@ UI::signal_pipe_callback (void *arg, int fd, GdkInputCondition cond)
/* flush (nonblocking) pipe */
while (read (fd, buf, 256) > 0);
while (read (fd, buf, 256) > 0) {}
((UI *) arg)->handle_ui_requests ();
}