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);
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()) {
#include <jack/jack.h>
#include <jack/transport.h>
#include <ardour/types.h>
+#include <ardour/data_type.h>
namespace ARDOUR {
/*
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
#include <cstdlib> // for posix_memalign
#include <cassert>
#include <ardour/types.h>
-#include <jack/jack.h>
+#include <ardour/data_type.h>
namespace ARDOUR {
/** 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;
{
public:
AudioBuffer(size_t capacity)
- : Buffer(AUDIO, capacity)
+ : Buffer(DataType::AUDIO, capacity)
, _data(NULL)
{
_size = capacity; // For audio buffers, size = capacity (always)
#include <ardour/state_manager.h>
#include <ardour/curve.h>
#include <ardour/types.h>
+#include <ardour/data_type.h>
using std::string;
using std::vector;
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();
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);
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();
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 ();
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;
Splice
};
- enum RegionPoint {
+ enum RegionPoint {
Start,
End,
SyncPoint
PeakDatum min;
PeakDatum max;
};
-
- enum DataType {
- NIL = 0,
- AUDIO,
- MIDI
- };
}
std::istream& operator>>(std::istream& o, ARDOUR::SampleFormat& sf);
}
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) {
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;
#include <ardour/auditioner.h>
#include <ardour/audioplaylist.h>
#include <ardour/panner.h>
+#include <ardour/data_type.h>
using namespace std;
using namespace ARDOUR;
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 ();
Port* our_port;
char name[64];
- if (type == NIL)
+ if (type == DataType::NIL)
type = _default_type;
{
Port* our_port;
char name[64];
- if (type == NIL)
+ if (type == DataType::NIL)
type = _default_type;
{
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");
}
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) {
#include <ardour/crossfade.h>
#include <ardour/playlist.h>
#include <ardour/click.h>
+#include <ardour/data_type.h>
#ifdef HAVE_LIBLO
#include <ardour/osc.h>
} 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"),