summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/port.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/ardour/port.h')
-rw-r--r--libs/ardour/ardour/port.h73
1 files changed, 36 insertions, 37 deletions
diff --git a/libs/ardour/ardour/port.h b/libs/ardour/ardour/port.h
index 93ed2777e4..86c99cb7e3 100644
--- a/libs/ardour/ardour/port.h
+++ b/libs/ardour/ardour/port.h
@@ -33,24 +33,24 @@ class AudioEngine;
class Port : public sigc::trackable {
public:
virtual ~Port() {
- free (port);
+ free (_port);
}
Sample *get_buffer (jack_nframes_t nframes) {
if (_flags & JackPortIsOutput) {
return _buffer;
} else {
- return (Sample *) jack_port_get_buffer (port, nframes);
+ return (Sample *) jack_port_get_buffer (_port, nframes);
}
}
void reset_buffer () {
if (_flags & JackPortIsOutput) {
- _buffer = (Sample *) jack_port_get_buffer (port, 0);
+ _buffer = (Sample *) jack_port_get_buffer (_port, 0);
} else {
_buffer = 0; /* catch illegal attempts to use it */
}
- silent = false;
+ _silent = false;
}
std::string name() {
@@ -58,7 +58,7 @@ class Port : public sigc::trackable {
}
std::string short_name() {
- return jack_port_short_name (port);
+ return jack_port_short_name (_port);
}
int set_name (std::string str);
@@ -68,7 +68,7 @@ class Port : public sigc::trackable {
}
bool is_mine (jack_client_t *client) {
- return jack_port_is_mine (client, port);
+ return jack_port_is_mine (client, _port);
}
const char* type() const {
@@ -76,21 +76,21 @@ class Port : public sigc::trackable {
}
int connected () const {
- return jack_port_connected (port);
+ return jack_port_connected (_port);
}
bool connected_to (const std::string& portname) const {
- return jack_port_connected_to (port, portname.c_str());
+ return jack_port_connected_to (_port, portname.c_str());
}
const char ** get_connections () const {
- return jack_port_get_connections (port);
+ return jack_port_get_connections (_port);
}
void reset_overs () {
_short_overs = 0;
_long_overs = 0;
- overlen = 0;
+ _overlen = 0;
}
void reset_peak_meter () {
@@ -103,18 +103,18 @@ class Port : public sigc::trackable {
}
void enable_metering() {
- metering++;
+ _metering++;
}
void disable_metering () {
- if (metering) { metering--; }
+ if (_metering) { _metering--; }
}
- float peak_db() const { return _peak_db; }
+ float peak_db() const { return _peak_db; }
jack_default_audio_sample_t peak() const { return _peak; }
uint32_t short_overs () const { return _short_overs; }
- uint32_t long_overs () const { return _long_overs; }
+ uint32_t long_overs () const { return _long_overs; }
static void set_short_over_length (jack_nframes_t);
static void set_long_over_length (jack_nframes_t);
@@ -128,7 +128,7 @@ class Port : public sigc::trackable {
}
bool monitoring_input () const {
- return jack_port_monitoring_input (port);
+ return jack_port_monitoring_input (_port);
}
bool can_monitor () const {
@@ -136,30 +136,29 @@ class Port : public sigc::trackable {
}
void ensure_monitor_input (bool yn) {
- jack_port_request_monitor (port, yn);
+ jack_port_request_monitor (_port, yn);
}
void request_monitor_input (bool yn) {
- jack_port_request_monitor (port, yn);
+ jack_port_request_monitor (_port, yn);
}
jack_nframes_t latency () const {
- return jack_port_get_latency (port);
+ return jack_port_get_latency (_port);
}
void set_latency (jack_nframes_t nframes) {
- jack_port_set_latency (port, nframes);
+ jack_port_set_latency (_port, nframes);
}
sigc::signal<void,bool> MonitorInputChanged;
sigc::signal<void,bool> ClockSyncChanged;
- bool is_silent() const { return silent; }
+ bool is_silent() const { return _silent; }
+ /** Assumes that the port is an audio output port */
void silence (jack_nframes_t nframes, jack_nframes_t offset) {
- /* assumes that the port is an output port */
-
- if (!silent) {
+ if (!_silent) {
memset (_buffer + offset, 0, sizeof (Sample) * nframes);
if (offset == 0) {
/* XXX this isn't really true, but i am not sure
@@ -167,13 +166,13 @@ class Port : public sigc::trackable {
want to set it true when the entire port
buffer has been overrwritten.
*/
- silent = true;
+ _silent = true;
}
}
}
void mark_silence (bool yn) {
- silent = yn;
+ _silent = yn;
}
private:
@@ -184,7 +183,7 @@ class Port : public sigc::trackable {
/* engine isn't supposed to below here */
- Sample *_buffer;
+ Sample *_buffer;
/* cache these 3 from JACK so that we can
access them for reconnecting.
@@ -194,18 +193,18 @@ class Port : public sigc::trackable {
std::string _type;
std::string _name;
- bool last_monitor : 1;
- bool silent : 1;
- jack_port_t *port;
- jack_nframes_t overlen;
- jack_default_audio_sample_t _peak;
- float _peak_db;
- uint32_t _short_overs;
- uint32_t _long_overs;
- unsigned short metering;
+ bool _last_monitor : 1;
+ bool _silent : 1;
+ jack_port_t *_port;
+ jack_nframes_t _overlen;
+ jack_default_audio_sample_t _peak;
+ float _peak_db;
+ uint32_t _short_overs;
+ uint32_t _long_overs;
+ unsigned short _metering;
- static jack_nframes_t long_over_length;
- static jack_nframes_t short_over_length;
+ static jack_nframes_t _long_over_length;
+ static jack_nframes_t _short_over_length;
};
} // namespace ARDOUR