diff options
-rw-r--r-- | gtk2_ardour/fft_graph.cc | 4 | ||||
-rw-r--r-- | gtk2_ardour/pan_automation_time_axis.cc | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/audioengine.h | 1 | ||||
-rw-r--r-- | libs/ardour/ardour/buffer.h | 44 | ||||
-rw-r--r-- | libs/ardour/ardour/io.h | 7 | ||||
-rw-r--r-- | libs/ardour/ardour/route.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/track.h | 4 | ||||
-rw-r--r-- | libs/ardour/ardour/types.h | 8 | ||||
-rw-r--r-- | libs/ardour/audioengine.cc | 4 | ||||
-rw-r--r-- | libs/ardour/auditioner.cc | 5 | ||||
-rw-r--r-- | libs/ardour/io.cc | 4 | ||||
-rw-r--r-- | libs/ardour/route.cc | 6 | ||||
-rw-r--r-- | libs/ardour/session.cc | 3 |
13 files changed, 27 insertions, 67 deletions
diff --git a/gtk2_ardour/fft_graph.cc b/gtk2_ardour/fft_graph.cc index 7c8b4b4095..367dc54b7c 100644 --- a/gtk2_ardour/fft_graph.cc +++ b/gtk2_ardour/fft_graph.cc @@ -234,11 +234,11 @@ FFTGraph::draw_scales(Glib::RefPtr<Gdk::Window> window) while (_logScale[logscale_pos] < position_on_scale) logscale_pos++; - int coord = v_margin + 1.0 + position_on_scale; + int coord = (int)(v_margin + 1.0 + position_on_scale); int SR = 44100; - int rate_at_pos = (double)(SR/2) * (double)logscale_pos / (double)_dataSize; + int rate_at_pos = (int)((double)(SR/2) * (double)logscale_pos / (double)_dataSize); char buf[32]; snprintf(buf,32,"%dhz",rate_at_pos); diff --git a/gtk2_ardour/pan_automation_time_axis.cc b/gtk2_ardour/pan_automation_time_axis.cc index de1fae1732..fcef6f812c 100644 --- a/gtk2_ardour/pan_automation_time_axis.cc +++ b/gtk2_ardour/pan_automation_time_axis.cc @@ -105,7 +105,7 @@ void PanAutomationTimeAxisView::add_line (AutomationLine& line) { char buf[32]; - snprintf(buf,32,"Line %d",lines.size()+1); + snprintf(buf,32,"Line %ld",lines.size()+1); multiline_selector.append_text(buf); if (lines.empty()) { diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h index 81370e379c..e7500fc7a2 100644 --- a/libs/ardour/ardour/audioengine.h +++ b/libs/ardour/ardour/audioengine.h @@ -35,6 +35,7 @@ #include <jack/jack.h> #include <jack/transport.h> #include <ardour/types.h> +#include <ardour/data_type.h> namespace ARDOUR { diff --git a/libs/ardour/ardour/buffer.h b/libs/ardour/ardour/buffer.h index 3e4a119710..8a88802ecb 100644 --- a/libs/ardour/ardour/buffer.h +++ b/libs/ardour/ardour/buffer.h @@ -1,6 +1,5 @@ /* Copyright (C) 2006 Paul Davis - Written by Dave Robillard, 2006 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -24,7 +23,7 @@ #include <cstdlib> // for posix_memalign #include <cassert> #include <ardour/types.h> -#include <jack/jack.h> +#include <ardour/data_type.h> namespace ARDOUR { @@ -60,44 +59,7 @@ public: /** Type of this buffer. * Based on this you can static cast a Buffer* to the desired type. */ - virtual DataType type() const { return _type; } - - /** Jack type (eg JACK_DEFAULT_AUDIO_TYPE) */ - const char* jack_type() const { return type_to_jack_type(type()); } - - /** String type as saved in session XML files (eg "audio" or "midi") */ - const char* type_string() const { return type_to_string(type()); } - - /* The below static methods need to be separate from the above methods - * because the conversion is needed in places where there's no Buffer. - * These should probably live somewhere else... - */ - - static const char* type_to_jack_type(DataType t) { - switch (t) { - case AUDIO: return JACK_DEFAULT_AUDIO_TYPE; - //case MIDI: return JACK_DEFAULT_MIDI_TYPE; - default: return ""; - } - } - - static const char* type_to_string(DataType t) { - switch (t) { - case AUDIO: return "audio"; - case MIDI: return "midi"; - default: return "unknown"; // reeeally shouldn't ever happen - } - } - - /** Used for loading from XML (route default types etc) */ - static DataType type_from_string(const string& str) { - if (str == "audio") - return AUDIO; - else if (str == "midi") - return MIDI; - else - return NIL; - } + DataType type() const { return _type; } protected: DataType _type; @@ -114,7 +76,7 @@ class AudioBuffer : public Buffer { public: AudioBuffer(size_t capacity) - : Buffer(AUDIO, capacity) + : Buffer(DataType::AUDIO, capacity) , _data(NULL) { _size = capacity; // For audio buffers, size = capacity (always) diff --git a/libs/ardour/ardour/io.h b/libs/ardour/ardour/io.h index 35b20f655e..b116a58b97 100644 --- a/libs/ardour/ardour/io.h +++ b/libs/ardour/ardour/io.h @@ -39,6 +39,7 @@ #include <ardour/state_manager.h> #include <ardour/curve.h> #include <ardour/types.h> +#include <ardour/data_type.h> using std::string; using std::vector; @@ -67,7 +68,7 @@ class IO : public Stateful, public ARDOUR::StateManager IO (Session&, string name, int input_min = -1, int input_max = -1, int output_min = -1, int output_max = -1, - DataType default_type = AUDIO); + DataType default_type = DataType::AUDIO); virtual ~IO(); @@ -116,8 +117,8 @@ class IO : public Stateful, public ARDOUR::StateManager Connection *input_connection() const { return _input_connection; } Connection *output_connection() const { return _output_connection; } - int add_input_port (string source, void *src, DataType type = NIL); - int add_output_port (string destination, void *src, DataType type = NIL); + int add_input_port (string source, void *src, DataType type = DataType::NIL); + int add_output_port (string destination, void *src, DataType type = DataType::NIL); int remove_input_port (Port *, void *src); int remove_output_port (Port *, void *src); diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index ea4a2374d4..8271c1cf6a 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -70,7 +70,7 @@ class Route : public IO Route (Session&, std::string name, int input_min, int input_max, int output_min, int output_max, - Flag flags = Flag(0), DataType default_type = AUDIO); + Flag flags = Flag(0), DataType default_type = DataType::AUDIO); Route (Session&, const XMLNode&); virtual ~Route(); diff --git a/libs/ardour/ardour/track.h b/libs/ardour/ardour/track.h index 707ead1573..f16e9d29d9 100644 --- a/libs/ardour/ardour/track.h +++ b/libs/ardour/ardour/track.h @@ -31,7 +31,7 @@ class RouteGroup; class Track : public Route { public: - Track (Session&, string name, Route::Flag f = Route::Flag (0), TrackMode m = Normal, DataType default_type = AUDIO); + Track (Session&, string name, Route::Flag f = Route::Flag (0), TrackMode m = Normal, DataType default_type = DataType::AUDIO); virtual ~Track (); @@ -91,7 +91,7 @@ class Track : public Route sigc::signal<void> FreezeChange; protected: - Track (Session& sess, const XMLNode& node, DataType default_type = AUDIO); + Track (Session& sess, const XMLNode& node, DataType default_type = DataType::AUDIO); virtual XMLNode& state (bool full) = 0; diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index e073b413bb..b2230f12d7 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -193,7 +193,7 @@ namespace ARDOUR { Splice }; - enum RegionPoint { + enum RegionPoint { Start, End, SyncPoint @@ -243,12 +243,6 @@ namespace ARDOUR { PeakDatum min; PeakDatum max; }; - - enum DataType { - NIL = 0, - AUDIO, - MIDI - }; } std::istream& operator>>(std::istream& o, ARDOUR::SampleFormat& sf); diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc index 5618c7ef5f..982a7c5971 100644 --- a/libs/ardour/audioengine.cc +++ b/libs/ardour/audioengine.cc @@ -401,7 +401,7 @@ AudioEngine::register_input_port (DataType type, const string& portname) } jack_port_t *p = jack_port_register (_jack, portname.c_str(), - Buffer::type_to_jack_type(type), JackPortIsInput, 0); + type.to_jack_type(), JackPortIsInput, 0); if (p) { @@ -435,7 +435,7 @@ AudioEngine::register_output_port (DataType type, const string& portname) jack_port_t *p; if ((p = jack_port_register (_jack, portname.c_str(), - Buffer::type_to_jack_type(type), JackPortIsOutput, 0)) != 0) { + type.to_jack_type(), JackPortIsOutput, 0)) != 0) { Port *newport = new Port (p); ports.insert (ports.begin(), newport); return newport; diff --git a/libs/ardour/auditioner.cc b/libs/ardour/auditioner.cc index 81f64d2671..e48f103b9f 100644 --- a/libs/ardour/auditioner.cc +++ b/libs/ardour/auditioner.cc @@ -27,6 +27,7 @@ #include <ardour/auditioner.h> #include <ardour/audioplaylist.h> #include <ardour/panner.h> +#include <ardour/data_type.h> using namespace std; using namespace ARDOUR; @@ -44,12 +45,12 @@ Auditioner::Auditioner (Session& s) defer_pan_reset (); if (left.length()) { - add_output_port (left, this, AUDIO); + add_output_port (left, this, DataType::AUDIO); } if (right.length()) { audio_diskstream().add_channel(); - add_output_port (right, this, AUDIO); + add_output_port (right, this, DataType::AUDIO); } allow_pan_reset (); diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index a70bf8abd3..2dfd735a6b 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -797,7 +797,7 @@ IO::add_output_port (string destination, void* src, DataType type) Port* our_port; char name[64]; - if (type == NIL) + if (type == DataType::NIL) type = _default_type; { @@ -909,7 +909,7 @@ IO::add_input_port (string source, void* src, DataType type) Port* our_port; char name[64]; - if (type == NIL) + if (type == DataType::NIL) type = _default_type; { diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index effb8432d1..b47981a47e 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -1333,7 +1333,7 @@ Route::state(bool full_state) node->add_property("flags", buf); } - node->add_property("default-type", Buffer::type_to_string(_default_type)); + node->add_property("default-type", _default_type.to_string()); node->add_property("active", _active?"yes":"no"); node->add_property("muted", _muted?"yes":"no"); @@ -1510,8 +1510,8 @@ Route::set_state (const XMLNode& node) } if ((prop = node.property ("default-type")) != 0) { - _default_type = Buffer::type_from_string(prop->value()); - assert(_default_type != NIL); + _default_type = DataType(prop->value()); + assert(_default_type != DataType::NIL); } if ((prop = node.property ("phase-invert")) != 0) { diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 45afdf479f..63797c4edd 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -64,6 +64,7 @@ #include <ardour/crossfade.h> #include <ardour/playlist.h> #include <ardour/click.h> +#include <ardour/data_type.h> #ifdef HAVE_LIBLO #include <ardour/osc.h> @@ -1807,7 +1808,7 @@ Session::new_audio_route (int input_channels, int output_channels) } while (n < (UINT_MAX-1)); try { - shared_ptr<Route> bus (new Route (*this, bus_name, -1, -1, -1, -1, Route::Flag(0), AUDIO)); + shared_ptr<Route> bus (new Route (*this, bus_name, -1, -1, -1, -1, Route::Flag(0), DataType::AUDIO)); if (bus->ensure_io (input_channels, output_channels, false, this)) { error << string_compose (_("cannot configure %1 in/%2 out configuration for new audio track"), |