another in-progress snapshot of gtk2_ardour after getting audio_clock.cc to compile
This commit is contained in:
parent
8fb70885ec
commit
1ee38e7a7f
|
@ -100,8 +100,6 @@ AudioClock::AudioClock (const string& clock_name, bool transient, const string&
|
||||||
, corner_radius (4)
|
, corner_radius (4)
|
||||||
, font_size (10240)
|
, font_size (10240)
|
||||||
, editing (false)
|
, editing (false)
|
||||||
, bbt_reference_time (-1)
|
|
||||||
, last_when(0)
|
|
||||||
, last_pdelta (0)
|
, last_pdelta (0)
|
||||||
, last_sdelta (0)
|
, last_sdelta (0)
|
||||||
, dragging (false)
|
, dragging (false)
|
||||||
|
@ -523,7 +521,7 @@ AudioClock::end_edit (bool modify)
|
||||||
if (is_duration) {
|
if (is_duration) {
|
||||||
pos = sample_duration_from_bbt_string (bbt_reference_time, edit_string);
|
pos = sample_duration_from_bbt_string (bbt_reference_time, edit_string);
|
||||||
} else {
|
} else {
|
||||||
pos = samples_from_bbt_string (0, edit_string);
|
pos = samples_from_bbt_string (timepos_t(), edit_string);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -540,7 +538,7 @@ AudioClock::end_edit (bool modify)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioClock::set (pos, true);
|
AudioClock::set (timepos_t (pos), true);
|
||||||
_layout->set_attributes (normal_attributes);
|
_layout->set_attributes (normal_attributes);
|
||||||
ValueChanged(); /* EMIT_SIGNAL */
|
ValueChanged(); /* EMIT_SIGNAL */
|
||||||
}
|
}
|
||||||
|
@ -571,31 +569,32 @@ AudioClock::drop_focus ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
samplecnt_t
|
timecnt_t
|
||||||
AudioClock::parse_as_seconds_distance (const std::string& str)
|
AudioClock::parse_as_seconds_distance (const std::string& str)
|
||||||
{
|
{
|
||||||
float f;
|
float f;
|
||||||
|
|
||||||
if (sscanf (str.c_str(), "%f", &f) == 1) {
|
if (sscanf (str.c_str(), "%f", &f) == 1) {
|
||||||
return f * _session->sample_rate();
|
return timecnt_t (f * _session->sample_rate());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return timecnt_t (samplecnt_t (0));
|
||||||
}
|
}
|
||||||
|
|
||||||
samplecnt_t
|
timecnt_t
|
||||||
AudioClock::parse_as_samples_distance (const std::string& str)
|
AudioClock::parse_as_samples_distance (const std::string& str)
|
||||||
{
|
{
|
||||||
samplecnt_t f;
|
samplecnt_t samples = 0;
|
||||||
|
|
||||||
if (sscanf (str.c_str(), "%" PRId64, &f) == 1) {
|
if (sscanf (str.c_str(), "%" PRId64, &samples) == 1) {
|
||||||
return f;
|
return timecnt_t (samples);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return timecnt_t (samples);
|
||||||
}
|
}
|
||||||
|
|
||||||
samplecnt_t
|
timecnt_t
|
||||||
AudioClock::parse_as_minsec_distance (const std::string& str)
|
AudioClock::parse_as_minsec_distance (const std::string& str)
|
||||||
{
|
{
|
||||||
samplecnt_t sr = _session->sample_rate();
|
samplecnt_t sr = _session->sample_rate();
|
||||||
|
@ -603,49 +602,57 @@ AudioClock::parse_as_minsec_distance (const std::string& str)
|
||||||
int secs;
|
int secs;
|
||||||
int mins;
|
int mins;
|
||||||
int hrs;
|
int hrs;
|
||||||
|
samplecnt_t samples = 0;
|
||||||
|
|
||||||
switch (str.length()) {
|
switch (str.length()) {
|
||||||
case 0:
|
case 0:
|
||||||
return 0;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
case 3:
|
case 3:
|
||||||
case 4:
|
case 4:
|
||||||
sscanf (str.c_str(), "%" PRId32, &msecs);
|
sscanf (str.c_str(), "%" PRId32, &msecs);
|
||||||
return msecs * (sr / 1000);
|
samples = msecs * (sr / 1000);
|
||||||
|
break;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
sscanf (str.c_str(), "%1" PRId32 "%" PRId32, &secs, &msecs);
|
sscanf (str.c_str(), "%1" PRId32 "%" PRId32, &secs, &msecs);
|
||||||
return (secs * sr) + (msecs * (sr/1000));
|
samples = (secs * sr) + (msecs * (sr/1000));
|
||||||
|
break;
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
sscanf (str.c_str(), "%2" PRId32 "%" PRId32, &secs, &msecs);
|
sscanf (str.c_str(), "%2" PRId32 "%" PRId32, &secs, &msecs);
|
||||||
return (secs * sr) + (msecs * (sr/1000));
|
samples = (secs * sr) + (msecs * (sr/1000));
|
||||||
|
break;
|
||||||
|
|
||||||
case 7:
|
case 7:
|
||||||
sscanf (str.c_str(), "%1" PRId32 "%2" PRId32 "%" PRId32, &mins, &secs, &msecs);
|
sscanf (str.c_str(), "%1" PRId32 "%2" PRId32 "%" PRId32, &mins, &secs, &msecs);
|
||||||
return (mins * 60 * sr) + (secs * sr) + (msecs * (sr/1000));
|
samples = (mins * 60 * sr) + (secs * sr) + (msecs * (sr/1000));
|
||||||
|
break;
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
sscanf (str.c_str(), "%2" PRId32 "%2" PRId32 "%" PRId32, &mins, &secs, &msecs);
|
sscanf (str.c_str(), "%2" PRId32 "%2" PRId32 "%" PRId32, &mins, &secs, &msecs);
|
||||||
return (mins * 60 * sr) + (secs * sr) + (msecs * (sr/1000));
|
samples = (mins * 60 * sr) + (secs * sr) + (msecs * (sr/1000));
|
||||||
|
break;
|
||||||
|
|
||||||
case 9:
|
case 9:
|
||||||
sscanf (str.c_str(), "%1" PRId32 "%2" PRId32 "%2" PRId32 "%" PRId32, &hrs, &mins, &secs, &msecs);
|
sscanf (str.c_str(), "%1" PRId32 "%2" PRId32 "%2" PRId32 "%" PRId32, &hrs, &mins, &secs, &msecs);
|
||||||
return (hrs * 3600 * sr) + (mins * 60 * sr) + (secs * sr) + (msecs * (sr/1000));
|
samples = (hrs * 3600 * sr) + (mins * 60 * sr) + (secs * sr) + (msecs * (sr/1000));
|
||||||
|
break;
|
||||||
|
|
||||||
case 10:
|
case 10:
|
||||||
sscanf (str.c_str(), "%1" PRId32 "%2" PRId32 "%2" PRId32 "%" PRId32, &hrs, &mins, &secs, &msecs);
|
sscanf (str.c_str(), "%1" PRId32 "%2" PRId32 "%2" PRId32 "%" PRId32, &hrs, &mins, &secs, &msecs);
|
||||||
return (hrs * 3600 * sr) + (mins * 60 * sr) + (secs * sr) + (msecs * (sr/1000));
|
samples = (hrs * 3600 * sr) + (mins * 60 * sr) + (secs * sr) + (msecs * (sr/1000));
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return timecnt_t (samples);
|
||||||
}
|
}
|
||||||
|
|
||||||
samplecnt_t
|
timecnt_t
|
||||||
AudioClock::parse_as_timecode_distance (const std::string& str)
|
AudioClock::parse_as_timecode_distance (const std::string& str)
|
||||||
{
|
{
|
||||||
double fps = _session->timecode_frames_per_second();
|
double fps = _session->timecode_frames_per_second();
|
||||||
|
@ -654,53 +661,61 @@ AudioClock::parse_as_timecode_distance (const std::string& str)
|
||||||
int secs;
|
int secs;
|
||||||
int mins;
|
int mins;
|
||||||
int hrs;
|
int hrs;
|
||||||
|
samplecnt_t ret = 0;
|
||||||
|
|
||||||
switch (str.length()) {
|
switch (str.length()) {
|
||||||
case 0:
|
case 0:
|
||||||
return 0;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
sscanf (str.c_str(), "%" PRId32, &samples);
|
sscanf (str.c_str(), "%" PRId32, &samples);
|
||||||
return llrint ((samples/(float)fps) * sr);
|
ret = llrint ((samples/(float)fps) * sr);
|
||||||
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
sscanf (str.c_str(), "%1" PRId32 "%" PRId32, &secs, &samples);
|
sscanf (str.c_str(), "%1" PRId32 "%" PRId32, &secs, &samples);
|
||||||
return (secs * sr) + llrint ((samples/(float)fps) * sr);
|
ret = (secs * sr) + llrint ((samples/(float)fps) * sr);
|
||||||
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
sscanf (str.c_str(), "%2" PRId32 "%" PRId32, &secs, &samples);
|
sscanf (str.c_str(), "%2" PRId32 "%" PRId32, &secs, &samples);
|
||||||
return (secs * sr) + llrint ((samples/(float)fps) * sr);
|
ret = (secs * sr) + llrint ((samples/(float)fps) * sr);
|
||||||
|
break;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
sscanf (str.c_str(), "%1" PRId32 "%2" PRId32 "%" PRId32, &mins, &secs, &samples);
|
sscanf (str.c_str(), "%1" PRId32 "%2" PRId32 "%" PRId32, &mins, &secs, &samples);
|
||||||
return (mins * 60 * sr) + (secs * sr) + llrint ((samples/(float)fps) * sr);
|
ret = (mins * 60 * sr) + (secs * sr) + llrint ((samples/(float)fps) * sr);
|
||||||
|
break;
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
sscanf (str.c_str(), "%2" PRId32 "%2" PRId32 "%" PRId32, &mins, &secs, &samples);
|
sscanf (str.c_str(), "%2" PRId32 "%2" PRId32 "%" PRId32, &mins, &secs, &samples);
|
||||||
return (mins * 60 * sr) + (secs * sr) + llrint ((samples/(float)fps) * sr);
|
ret = (mins * 60 * sr) + (secs * sr) + llrint ((samples/(float)fps) * sr);
|
||||||
|
break;
|
||||||
|
|
||||||
case 7:
|
case 7:
|
||||||
sscanf (str.c_str(), "%1" PRId32 "%2" PRId32 "%2" PRId32 "%" PRId32, &hrs, &mins, &secs, &samples);
|
sscanf (str.c_str(), "%1" PRId32 "%2" PRId32 "%2" PRId32 "%" PRId32, &hrs, &mins, &secs, &samples);
|
||||||
return (hrs * 3600 * sr) + (mins * 60 * sr) + (secs * sr) + llrint ((samples/(float)fps) * sr);
|
ret = (hrs * 3600 * sr) + (mins * 60 * sr) + (secs * sr) + llrint ((samples/(float)fps) * sr);
|
||||||
|
break;
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
sscanf (str.c_str(), "%2" PRId32 "%2" PRId32 "%2" PRId32 "%" PRId32, &hrs, &mins, &secs, &samples);
|
sscanf (str.c_str(), "%2" PRId32 "%2" PRId32 "%2" PRId32 "%" PRId32, &hrs, &mins, &secs, &samples);
|
||||||
return (hrs * 3600 * sr) + (mins * 60 * sr) + (secs * sr) + llrint ((samples/(float)fps) * sr);
|
ret = (hrs * 3600 * sr) + (mins * 60 * sr) + (secs * sr) + llrint ((samples/(float)fps) * sr);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return timecnt_t (ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
samplecnt_t
|
timecnt_t
|
||||||
AudioClock::parse_as_bbt_distance (const std::string&)
|
AudioClock::parse_as_bbt_distance (const std::string&)
|
||||||
{
|
{
|
||||||
return 0;
|
return timecnt_t ();
|
||||||
}
|
}
|
||||||
|
|
||||||
samplecnt_t
|
timecnt_t
|
||||||
AudioClock::parse_as_distance (const std::string& instr)
|
AudioClock::parse_as_distance (const std::string& instr)
|
||||||
{
|
{
|
||||||
switch (_mode) {
|
switch (_mode) {
|
||||||
|
@ -720,7 +735,7 @@ AudioClock::parse_as_distance (const std::string& instr)
|
||||||
return parse_as_seconds_distance (instr);
|
return parse_as_seconds_distance (instr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
return timecnt_t();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -758,23 +773,23 @@ AudioClock::end_edit_relative (bool add)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
samplecnt_t samples = parse_as_distance (input_string);
|
timecnt_t distance = parse_as_distance (input_string);
|
||||||
|
|
||||||
editing = false;
|
editing = false;
|
||||||
|
|
||||||
editing = false;
|
editing = false;
|
||||||
_layout->set_attributes (normal_attributes);
|
_layout->set_attributes (normal_attributes);
|
||||||
|
|
||||||
if (samples != 0) {
|
if (!distance.zero()) {
|
||||||
if (add) {
|
if (add) {
|
||||||
AudioClock::set (current_time() + samples, true);
|
AudioClock::set (current_time() + timepos_t (distance), true);
|
||||||
} else {
|
} else {
|
||||||
samplepos_t c = current_time();
|
timepos_t c = current_time();
|
||||||
|
|
||||||
if (c > samples || _negative_allowed) {
|
if (c > timepos_t (distance)|| _negative_allowed) {
|
||||||
AudioClock::set (c - samples, true);
|
AudioClock::set (c.earlier (distance), true);
|
||||||
} else {
|
} else {
|
||||||
AudioClock::set (0, true);
|
AudioClock::set (timepos_t(), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ValueChanged (); /* EMIT SIGNAL */
|
ValueChanged (); /* EMIT SIGNAL */
|
||||||
|
@ -808,12 +823,12 @@ AudioClock::session_configuration_changed (std::string p)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
samplecnt_t current;
|
timepos_t current;
|
||||||
|
|
||||||
switch (_mode) {
|
switch (_mode) {
|
||||||
case Timecode:
|
case Timecode:
|
||||||
if (is_duration) {
|
if (is_duration) {
|
||||||
current = current_duration ();
|
current = timepos_t (current_duration ());
|
||||||
} else {
|
} else {
|
||||||
current = current_time ();
|
current = current_time ();
|
||||||
}
|
}
|
||||||
|
@ -825,15 +840,17 @@ AudioClock::session_configuration_changed (std::string p)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioClock::set (samplepos_t when, bool force, samplecnt_t offset)
|
AudioClock::set (timepos_t const & w, bool force, timecnt_t const & offset)
|
||||||
{
|
{
|
||||||
if ((!force && !is_visible()) || _session == 0) {
|
timepos_t when (w);
|
||||||
|
|
||||||
|
if ((!force && !is_visible()) || _session) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_offset = offset;
|
_offset = offset;
|
||||||
if (is_duration) {
|
if (is_duration) {
|
||||||
when = when - offset;
|
when = timepos_t (offset - when);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (when > _limit_pos) {
|
if (when > _limit_pos) {
|
||||||
|
@ -891,80 +908,13 @@ AudioClock::set (samplepos_t when, bool force, samplecnt_t offset)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
finish_set (timepos_t (when), btn_en);
|
finish_set (when, btn_en);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioClock::set_duration (Temporal::timecnt_t const & d, bool force, Temporal::timecnt_t const & offset)
|
AudioClock::set_duration (Temporal::timecnt_t const & d, bool force, Temporal::timecnt_t const & offset)
|
||||||
{
|
{
|
||||||
set_time (timepos_t (d), force, offset);
|
set (timepos_t (d), force, offset);
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
AudioClock::set_time (Temporal::timepos_t const & w, bool force, Temporal::timecnt_t const & offset)
|
|
||||||
{
|
|
||||||
Temporal::timepos_t when (w);
|
|
||||||
|
|
||||||
if ((!force && !is_visible()) || _session == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_duration) {
|
|
||||||
when = when.earlier (offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (when > _limit_pos) {
|
|
||||||
when = _limit_pos;
|
|
||||||
} else if (when < -_limit_pos) {
|
|
||||||
when = -_limit_pos;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (when == last_when && !force) {
|
|
||||||
#if 0 // XXX return if no change and no change forced. verify Aug/2014
|
|
||||||
if (_mode != Timecode && _mode != MinSec) {
|
|
||||||
/* may need to force display of TC source
|
|
||||||
* time, so don't return early.
|
|
||||||
*/
|
|
||||||
/* ^^ Why was that?, delta times?
|
|
||||||
* Timecode FPS, pull-up/down, etc changes
|
|
||||||
* trigger a 'session_property_changed' which
|
|
||||||
* eventually calls set(last_when, true)
|
|
||||||
*
|
|
||||||
* re-rendering the clock every 40ms or so just
|
|
||||||
* because we can is not ideal.
|
|
||||||
*/
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
bool btn_en = false;
|
|
||||||
|
|
||||||
if (!editing) {
|
|
||||||
|
|
||||||
switch (_mode) {
|
|
||||||
case Timecode:
|
|
||||||
set_timecode (when.sample(), force);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BBT:
|
|
||||||
_set_bbt (when.bbt(), when.bbt() < Temporal::timepos_t (Temporal::BBT_Time()));
|
|
||||||
btn_en = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MinSec:
|
|
||||||
set_minsec (when.sample(), force);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Samples:
|
|
||||||
set_samples (when.sample(), force);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
finish_set (when, btn_en);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1061,8 +1011,9 @@ AudioClock::set_out_of_bounds (bool negative)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioClock::set_samples (samplepos_t when, bool /*force*/)
|
AudioClock::set_samples (timepos_t const & w, bool /*force*/)
|
||||||
{
|
{
|
||||||
|
timepos_t when (w);
|
||||||
char buf[32];
|
char buf[32];
|
||||||
bool negative = false;
|
bool negative = false;
|
||||||
|
|
||||||
|
@ -1073,7 +1024,7 @@ AudioClock::set_samples (samplepos_t when, bool /*force*/)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (when < 0) {
|
if (when.negative()) {
|
||||||
when = -when;
|
when = -when;
|
||||||
negative = true;
|
negative = true;
|
||||||
}
|
}
|
||||||
|
@ -1081,10 +1032,10 @@ AudioClock::set_samples (samplepos_t when, bool /*force*/)
|
||||||
if (when >= _limit_pos) {
|
if (when >= _limit_pos) {
|
||||||
set_out_of_bounds (negative);
|
set_out_of_bounds (negative);
|
||||||
} else if (negative) {
|
} else if (negative) {
|
||||||
snprintf (buf, sizeof (buf), "-%10" PRId64, when);
|
snprintf (buf, sizeof (buf), "-%10" PRId64, when.samples());
|
||||||
_layout->set_text (buf);
|
_layout->set_text (buf);
|
||||||
} else {
|
} else {
|
||||||
snprintf (buf, sizeof (buf), " %10" PRId64, when);
|
snprintf (buf, sizeof (buf), " %10" PRId64, when.samples());
|
||||||
_layout->set_text (buf);
|
_layout->set_text (buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1111,7 +1062,7 @@ AudioClock::set_samples (samplepos_t when, bool /*force*/)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioClock::set_seconds (samplepos_t when, bool /*force*/)
|
AudioClock::set_seconds (timepos_t const & when, bool /*force*/)
|
||||||
{
|
{
|
||||||
char buf[32];
|
char buf[32];
|
||||||
|
|
||||||
|
@ -1123,12 +1074,12 @@ AudioClock::set_seconds (samplepos_t when, bool /*force*/)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (when >= _limit_pos || when <= -_limit_pos) {
|
if (when >= _limit_pos || when <= -_limit_pos) {
|
||||||
set_out_of_bounds (when < 0);
|
set_out_of_bounds (when.negative());
|
||||||
} else {
|
} else {
|
||||||
if (when < 0) {
|
if (when.negative()) {
|
||||||
snprintf (buf, sizeof (buf), "%12.1f", when / (float)_session->sample_rate());
|
snprintf (buf, sizeof (buf), "%12.1f", when.samples() / (float)_session->sample_rate());
|
||||||
} else {
|
} else {
|
||||||
snprintf (buf, sizeof (buf), " %11.1f", when / (float)_session->sample_rate());
|
snprintf (buf, sizeof (buf), " %11.1f", when.samples() / (float)_session->sample_rate());
|
||||||
}
|
}
|
||||||
_layout->set_text (buf);
|
_layout->set_text (buf);
|
||||||
}
|
}
|
||||||
|
@ -1194,7 +1145,7 @@ AudioClock::print_minsec (samplepos_t when, char* buf, size_t bufsize, float sam
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioClock::set_minsec (samplepos_t when, bool /*force*/)
|
AudioClock::set_minsec (timepos_t const & when, bool /*force*/)
|
||||||
{
|
{
|
||||||
char buf[32];
|
char buf[32];
|
||||||
|
|
||||||
|
@ -1207,9 +1158,9 @@ AudioClock::set_minsec (samplepos_t when, bool /*force*/)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (when >= _limit_pos || when <= -_limit_pos) {
|
if (when >= _limit_pos || when <= -_limit_pos) {
|
||||||
set_out_of_bounds (when < 0);
|
set_out_of_bounds (when.negative());
|
||||||
} else {
|
} else {
|
||||||
print_minsec (when, buf, sizeof (buf), _session->sample_rate());
|
print_minsec (when.samples(), buf, sizeof (buf), _session->sample_rate());
|
||||||
_layout->set_text (buf);
|
_layout->set_text (buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1217,8 +1168,9 @@ AudioClock::set_minsec (samplepos_t when, bool /*force*/)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioClock::set_timecode (samplepos_t when, bool /*force*/)
|
AudioClock::set_timecode (timepos_t const & w, bool /*force*/)
|
||||||
{
|
{
|
||||||
|
timepos_t when (w);
|
||||||
Timecode::Time TC;
|
Timecode::Time TC;
|
||||||
bool negative = false;
|
bool negative = false;
|
||||||
|
|
||||||
|
@ -1229,7 +1181,7 @@ AudioClock::set_timecode (samplepos_t when, bool /*force*/)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (when < 0) {
|
if (when.negative()) {
|
||||||
when = -when;
|
when = -when;
|
||||||
negative = true;
|
negative = true;
|
||||||
}
|
}
|
||||||
|
@ -1240,9 +1192,9 @@ AudioClock::set_timecode (samplepos_t when, bool /*force*/)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_duration) {
|
if (is_duration) {
|
||||||
_session->timecode_duration (when, TC);
|
_session->timecode_duration (when.samples(), TC);
|
||||||
} else {
|
} else {
|
||||||
_session->timecode_time (when, TC);
|
_session->timecode_time (when.samples(), TC);
|
||||||
}
|
}
|
||||||
|
|
||||||
TC.negative = TC.negative || negative;
|
TC.negative = TC.negative || negative;
|
||||||
|
@ -1253,8 +1205,10 @@ AudioClock::set_timecode (samplepos_t when, bool /*force*/)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AudioClock::set_bbt (samplepos_t when, samplecnt_t offset, bool /*force*/)
|
AudioClock::set_bbt (timepos_t const & w, timecnt_t const & o, bool /*force*/)
|
||||||
{
|
{
|
||||||
|
timepos_t when (w);
|
||||||
|
timecnt_t offset (o);
|
||||||
char buf[64];
|
char buf[64];
|
||||||
Temporal::BBT_Time BBT;
|
Temporal::BBT_Time BBT;
|
||||||
bool negative = false;
|
bool negative = false;
|
||||||
|
@ -1266,22 +1220,24 @@ AudioClock::set_bbt (samplepos_t when, samplecnt_t offset, bool /*force*/)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (when < 0) {
|
if (when.negative()) {
|
||||||
when = -when;
|
when = -when;
|
||||||
negative = true;
|
negative = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* handle a common case */
|
/* handle a common case */
|
||||||
|
#warning NUTEMPO FIXME new tempo map API
|
||||||
|
#if 0
|
||||||
if (is_duration) {
|
if (is_duration) {
|
||||||
if (when == 0) {
|
if (when.zero()) {
|
||||||
BBT.bars = 0;
|
BBT.bars = 0;
|
||||||
BBT.beats = 0;
|
BBT.beats = 0;
|
||||||
BBT.ticks = 0;
|
BBT.ticks = 0;
|
||||||
} else {
|
} else {
|
||||||
TempoMap& tmap (_session->tempo_map());
|
TempoMap& tmap (_session->tempo_map());
|
||||||
|
|
||||||
if (offset == 0) {
|
if (offset.zero()) {
|
||||||
offset = bbt_reference_time;
|
offset = timecnt_t (bbt_reference_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
const double divisions = tmap.meter_section_at_sample (offset).divisions_per_bar();
|
const double divisions = tmap.meter_section_at_sample (offset).divisions_per_bar();
|
||||||
|
@ -1319,7 +1275,7 @@ AudioClock::set_bbt (samplepos_t when, samplecnt_t offset, bool /*force*/)
|
||||||
} else {
|
} else {
|
||||||
BBT = _session->tempo_map().bbt_at_sample (when);
|
BBT = _session->tempo_map().bbt_at_sample (when);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (negative) {
|
if (negative) {
|
||||||
snprintf (buf, sizeof (buf), "-%03" PRIu32 BBT_BAR_CHAR "%02" PRIu32 BBT_BAR_CHAR "%04" PRIu32,
|
snprintf (buf, sizeof (buf), "-%03" PRIu32 BBT_BAR_CHAR "%02" PRIu32 BBT_BAR_CHAR "%04" PRIu32,
|
||||||
BBT.bars, BBT.beats, BBT.ticks);
|
BBT.bars, BBT.beats, BBT.ticks);
|
||||||
|
@ -1331,14 +1287,16 @@ AudioClock::set_bbt (samplepos_t when, samplecnt_t offset, bool /*force*/)
|
||||||
_layout->set_text (buf);
|
_layout->set_text (buf);
|
||||||
|
|
||||||
if (_with_info) {
|
if (_with_info) {
|
||||||
samplepos_t pos;
|
timepos_t pos;
|
||||||
|
|
||||||
if (bbt_reference_time < 0) {
|
if (bbt_reference_time.negative()) {
|
||||||
pos = when;
|
pos = when;
|
||||||
} else {
|
} else {
|
||||||
pos = bbt_reference_time;
|
pos = bbt_reference_time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#warning NUTEMPO FIXME new tempo map API
|
||||||
|
#if 0
|
||||||
TempoMetric m (_session->tempo_map().metric_at (pos));
|
TempoMetric m (_session->tempo_map().metric_at (pos));
|
||||||
|
|
||||||
#ifndef PLATFORM_WINDOWS
|
#ifndef PLATFORM_WINDOWS
|
||||||
|
@ -1358,6 +1316,7 @@ AudioClock::set_bbt (samplepos_t when, samplecnt_t offset, bool /*force*/)
|
||||||
|
|
||||||
snprintf (buf, sizeof(buf), "%g/%g", m.meter().divisions_per_bar(), m.meter().note_divisor());
|
snprintf (buf, sizeof(buf), "%g/%g", m.meter().divisions_per_bar(), m.meter().note_divisor());
|
||||||
_right_btn.set_text (string_compose ("%1: %2", S_("TimeSignature|TS"), buf), false);
|
_right_btn.set_text (string_compose ("%1: %2", S_("TimeSignature|TS"), buf), false);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1824,13 +1783,15 @@ AudioClock::on_scroll_event (GdkEventScroll *ev)
|
||||||
|
|
||||||
switch (ev->direction) {
|
switch (ev->direction) {
|
||||||
|
|
||||||
|
#warning NUTEMPO THIS SHOULD BE REVISITED FOR BeatTime
|
||||||
|
|
||||||
case GDK_SCROLL_UP:
|
case GDK_SCROLL_UP:
|
||||||
samples = get_sample_step (f, current_time(), 1);
|
samples = get_sample_step (f, current_time(), 1);
|
||||||
if (samples != 0) {
|
if (samples != 0) {
|
||||||
if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
|
if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
|
||||||
samples *= 10;
|
samples *= 10;
|
||||||
}
|
}
|
||||||
AudioClock::set (current_time() + samples, true);
|
AudioClock::set (current_time() + timepos_t (samples), true);
|
||||||
ValueChanged (); /* EMIT_SIGNAL */
|
ValueChanged (); /* EMIT_SIGNAL */
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1842,10 +1803,10 @@ AudioClock::on_scroll_event (GdkEventScroll *ev)
|
||||||
samples *= 10;
|
samples *= 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_negative_allowed && (double)current_time() - (double)samples < 0.0) {
|
if (!_negative_allowed && current_time().samples() < samples) {
|
||||||
AudioClock::set (0, true);
|
AudioClock::set (timepos_t (), true);
|
||||||
} else {
|
} else {
|
||||||
AudioClock::set (current_time() - samples, true);
|
AudioClock::set (current_time().earlier (timepos_t (samples)), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
ValueChanged (); /* EMIT_SIGNAL */
|
ValueChanged (); /* EMIT_SIGNAL */
|
||||||
|
@ -1888,16 +1849,16 @@ AudioClock::on_motion_notify_event (GdkEventMotion *ev)
|
||||||
if (floor (drag_accum) != 0) {
|
if (floor (drag_accum) != 0) {
|
||||||
|
|
||||||
samplepos_t samples;
|
samplepos_t samples;
|
||||||
samplepos_t pos;
|
timepos_t pos;
|
||||||
int dir;
|
int dir;
|
||||||
dir = (drag_accum < 0 ? 1:-1);
|
dir = (drag_accum < 0 ? 1:-1);
|
||||||
pos = current_time();
|
pos = current_time();
|
||||||
samples = get_sample_step (drag_field, pos, dir);
|
samples = get_sample_step (drag_field, pos, dir);
|
||||||
|
|
||||||
if (samples != 0 && samples * drag_accum < current_time()) {
|
if (samples != 0 && timepos_t (samples * drag_accum) < current_time()) {
|
||||||
AudioClock::set ((samplepos_t) floor (pos - drag_accum * samples), false); // minus because up is negative in GTK
|
AudioClock::set (timepos_t (pos.earlier (drag_accum * samples)), false); // minus because up is negative in GTK
|
||||||
} else {
|
} else {
|
||||||
AudioClock::set (0 , false);
|
AudioClock::set (timepos_t () , false);
|
||||||
}
|
}
|
||||||
|
|
||||||
drag_accum= 0;
|
drag_accum= 0;
|
||||||
|
@ -1908,7 +1869,7 @@ AudioClock::on_motion_notify_event (GdkEventMotion *ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
samplepos_t
|
samplepos_t
|
||||||
AudioClock::get_sample_step (Field field, samplepos_t pos, int dir)
|
AudioClock::get_sample_step (Field field, timepos_t const & pos, int dir)
|
||||||
{
|
{
|
||||||
samplecnt_t f = 0;
|
samplecnt_t f = 0;
|
||||||
Temporal::BBT_Time BBT;
|
Temporal::BBT_Time BBT;
|
||||||
|
@ -1954,19 +1915,22 @@ AudioClock::get_sample_step (Field field, samplepos_t pos, int dir)
|
||||||
BBT.bars = 1;
|
BBT.bars = 1;
|
||||||
BBT.beats = 0;
|
BBT.beats = 0;
|
||||||
BBT.ticks = 0;
|
BBT.ticks = 0;
|
||||||
f = _session->tempo_map().bbt_duration_at (pos,BBT,dir);
|
#warning NUTEMPO FIXME new tempo map API
|
||||||
|
//f = _session->tempo_map().bbt_duration_at (pos,BBT,dir);
|
||||||
break;
|
break;
|
||||||
case Beats:
|
case Beats:
|
||||||
BBT.bars = 0;
|
BBT.bars = 0;
|
||||||
BBT.beats = 1;
|
BBT.beats = 1;
|
||||||
BBT.ticks = 0;
|
BBT.ticks = 0;
|
||||||
f = _session->tempo_map().bbt_duration_at(pos,BBT,dir);
|
#warning NUTEMPO FIXME new tempo map API
|
||||||
|
//f = _session->tempo_map().bbt_duration_at(pos,BBT,dir);
|
||||||
break;
|
break;
|
||||||
case Ticks:
|
case Ticks:
|
||||||
BBT.bars = 0;
|
BBT.bars = 0;
|
||||||
BBT.beats = 0;
|
BBT.beats = 0;
|
||||||
BBT.ticks = 1;
|
BBT.ticks = 1;
|
||||||
f = _session->tempo_map().bbt_duration_at(pos,BBT,dir);
|
#warning NUTEMPO FIXME new tempo map API
|
||||||
|
//f = _session->tempo_map().bbt_duration_at(pos,BBT,dir);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
error << string_compose (_("programming error: %1"), "attempt to get samples from non-text field!") << endmsg;
|
error << string_compose (_("programming error: %1"), "attempt to get samples from non-text field!") << endmsg;
|
||||||
|
@ -1977,16 +1941,16 @@ AudioClock::get_sample_step (Field field, samplepos_t pos, int dir)
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
samplepos_t
|
timepos_t
|
||||||
AudioClock::current_time (samplepos_t) const
|
AudioClock::current_time () const
|
||||||
{
|
{
|
||||||
return last_when;
|
return last_when;
|
||||||
}
|
}
|
||||||
|
|
||||||
samplepos_t
|
timecnt_t
|
||||||
AudioClock::current_duration (samplepos_t pos) const
|
AudioClock::current_duration (timepos_t pos) const
|
||||||
{
|
{
|
||||||
samplepos_t ret = 0;
|
timecnt_t ret;
|
||||||
|
|
||||||
switch (_mode) {
|
switch (_mode) {
|
||||||
case BBT:
|
case BBT:
|
||||||
|
@ -1997,7 +1961,7 @@ AudioClock::current_duration (samplepos_t pos) const
|
||||||
case MinSec:
|
case MinSec:
|
||||||
case Seconds:
|
case Seconds:
|
||||||
case Samples:
|
case Samples:
|
||||||
ret = last_when;
|
ret = timecnt_t (last_when, pos);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2141,7 +2105,7 @@ AudioClock::samples_from_minsec_string (const string& str) const
|
||||||
}
|
}
|
||||||
|
|
||||||
samplepos_t
|
samplepos_t
|
||||||
AudioClock::samples_from_bbt_string (samplepos_t pos, const string& str) const
|
AudioClock::samples_from_bbt_string (timepos_t const & pos, const string& str) const
|
||||||
{
|
{
|
||||||
if (_session == 0) {
|
if (_session == 0) {
|
||||||
error << "AudioClock::current_time() called with BBT mode but without session!" << endmsg;
|
error << "AudioClock::current_time() called with BBT mode but without session!" << endmsg;
|
||||||
|
@ -2158,7 +2122,9 @@ AudioClock::samples_from_bbt_string (samplepos_t pos, const string& str) const
|
||||||
if (is_duration) {
|
if (is_duration) {
|
||||||
any.bbt.bars++;
|
any.bbt.bars++;
|
||||||
any.bbt.beats++;
|
any.bbt.beats++;
|
||||||
return _session->any_duration_to_samples (pos, any);
|
#warning NUTEMPO new tempo map/session API
|
||||||
|
//return _session->any_duration_to_samples (pos, any);
|
||||||
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
return _session->convert_to_samples (any);
|
return _session->convert_to_samples (any);
|
||||||
}
|
}
|
||||||
|
@ -2166,7 +2132,7 @@ AudioClock::samples_from_bbt_string (samplepos_t pos, const string& str) const
|
||||||
|
|
||||||
|
|
||||||
samplepos_t
|
samplepos_t
|
||||||
AudioClock::sample_duration_from_bbt_string (samplepos_t pos, const string& str) const
|
AudioClock::sample_duration_from_bbt_string (timepos_t const & pos, const string& str) const
|
||||||
{
|
{
|
||||||
if (_session == 0) {
|
if (_session == 0) {
|
||||||
error << "AudioClock::sample_duration_from_bbt_string() called with BBT mode but without session!" << endmsg;
|
error << "AudioClock::sample_duration_from_bbt_string() called with BBT mode but without session!" << endmsg;
|
||||||
|
@ -2179,7 +2145,9 @@ AudioClock::sample_duration_from_bbt_string (samplepos_t pos, const string& str)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return _session->tempo_map().bbt_duration_at(pos,bbt,1);
|
#warning NUTEMPO new tempo map API
|
||||||
|
//return _session->tempo_map().bbt_duration_at(pos,bbt,1);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
samplepos_t
|
samplepos_t
|
||||||
|
@ -2246,7 +2214,7 @@ AudioClock::set_from_playhead ()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioClock::set (_session->transport_sample());
|
AudioClock::set (timepos_t (_session->transport_sample()));
|
||||||
ValueChanged ();
|
ValueChanged ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2260,7 +2228,7 @@ AudioClock::locate ()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_session->request_locate (current_time());
|
_session->request_locate (current_time().samples());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -2392,7 +2360,7 @@ AudioClock::set_is_duration (bool yn, timepos_t const & p)
|
||||||
duration_position = timepos_t ();
|
duration_position = timepos_t ();
|
||||||
}
|
}
|
||||||
|
|
||||||
set_time (last_when, true);
|
set (last_when, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -73,8 +73,7 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr
|
||||||
|
|
||||||
void focus ();
|
void focus ();
|
||||||
|
|
||||||
virtual void set (samplepos_t, bool force = false, ARDOUR::samplecnt_t offset = 0);
|
virtual void set (Temporal::timepos_t const &, bool force = false, Temporal::timecnt_t const & offset = Temporal::timecnt_t());
|
||||||
void set_time (Temporal::timepos_t const &, bool force = false, Temporal::timecnt_t const & offset = Temporal::timecnt_t());
|
|
||||||
void set_duration (Temporal::timecnt_t const &, bool force = false, Temporal::timecnt_t const & offset = Temporal::timecnt_t());
|
void set_duration (Temporal::timecnt_t const &, bool force = false, Temporal::timecnt_t const & offset = Temporal::timecnt_t());
|
||||||
|
|
||||||
void set_from_playhead ();
|
void set_from_playhead ();
|
||||||
|
@ -88,8 +87,8 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr
|
||||||
|
|
||||||
std::string name() const { return _name; }
|
std::string name() const { return _name; }
|
||||||
|
|
||||||
samplepos_t current_time (samplepos_t position = 0) const;
|
Temporal::timepos_t current_time () const;
|
||||||
samplepos_t current_duration (samplepos_t position = 0) const;
|
Temporal::timecnt_t current_duration (Temporal::timepos_t position = Temporal::timepos_t()) const;
|
||||||
void set_session (ARDOUR::Session *s);
|
void set_session (ARDOUR::Session *s);
|
||||||
void set_negative_allowed (bool yn);
|
void set_negative_allowed (bool yn);
|
||||||
|
|
||||||
|
@ -116,7 +115,7 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr
|
||||||
protected:
|
protected:
|
||||||
void render (Cairo::RefPtr<Cairo::Context> const&, cairo_rectangle_t*);
|
void render (Cairo::RefPtr<Cairo::Context> const&, cairo_rectangle_t*);
|
||||||
bool get_is_duration () const { return is_duration; }
|
bool get_is_duration () const { return is_duration; }
|
||||||
ARDOUR::samplecnt_t offset () const { return _offset; }
|
Temporal::timecnt_t offset () const { return _offset; }
|
||||||
|
|
||||||
virtual void build_ops_menu ();
|
virtual void build_ops_menu ();
|
||||||
Gtk::Menu *ops_menu;
|
Gtk::Menu *ops_menu;
|
||||||
|
@ -142,10 +141,10 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr
|
||||||
bool _negative_allowed;
|
bool _negative_allowed;
|
||||||
bool edit_is_negative;
|
bool edit_is_negative;
|
||||||
|
|
||||||
samplepos_t _limit_pos;
|
Temporal::timepos_t _limit_pos;
|
||||||
Temporal::timepos_t duration_position;
|
Temporal::timepos_t duration_position;
|
||||||
|
|
||||||
ARDOUR::samplecnt_t _offset;
|
Temporal::timecnt_t _offset;
|
||||||
|
|
||||||
Glib::RefPtr<Pango::Layout> _layout;
|
Glib::RefPtr<Pango::Layout> _layout;
|
||||||
|
|
||||||
|
@ -201,8 +200,8 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr
|
||||||
std::string pre_edit_string;
|
std::string pre_edit_string;
|
||||||
std::string input_string;
|
std::string input_string;
|
||||||
|
|
||||||
samplepos_t bbt_reference_time;
|
Temporal::timepos_t bbt_reference_time;
|
||||||
samplepos_t last_when;
|
Temporal::timepos_t last_when;
|
||||||
bool last_pdelta;
|
bool last_pdelta;
|
||||||
bool last_sdelta;
|
bool last_sdelta;
|
||||||
|
|
||||||
|
@ -222,25 +221,25 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr
|
||||||
bool on_focus_out_event (GdkEventFocus*);
|
bool on_focus_out_event (GdkEventFocus*);
|
||||||
|
|
||||||
void set_slave_info ();
|
void set_slave_info ();
|
||||||
void set_timecode (samplepos_t, bool);
|
void set_timecode (Temporal::timepos_t const &, bool);
|
||||||
void set_bbt (samplepos_t, ARDOUR::samplecnt_t, bool);
|
void set_bbt (Temporal::timepos_t const &, Temporal::timecnt_t const &, bool);
|
||||||
void set_minsec (samplepos_t, bool);
|
void set_minsec (Temporal::timepos_t const &, bool);
|
||||||
void set_seconds (samplepos_t, bool);
|
void set_seconds (Temporal::timepos_t const &, bool);
|
||||||
void set_samples (samplepos_t, bool);
|
void set_samples (Temporal::timepos_t const &, bool);
|
||||||
void set_out_of_bounds (bool negative);
|
void set_out_of_bounds (bool negative);
|
||||||
void finish_set (Temporal::timepos_t const &, bool);
|
void finish_set (Temporal::timepos_t const &, bool);
|
||||||
|
|
||||||
void set_clock_dimensions (Gtk::Requisition&);
|
void set_clock_dimensions (Gtk::Requisition&);
|
||||||
|
|
||||||
samplepos_t get_sample_step (Field, samplepos_t pos = 0, int dir = 1);
|
samplepos_t get_sample_step (Field, Temporal::timepos_t const & pos = Temporal::timepos_t (), int dir = 1);
|
||||||
|
|
||||||
bool timecode_validate_edit (const std::string&);
|
bool timecode_validate_edit (const std::string&);
|
||||||
bool bbt_validate_edit (std::string&);
|
bool bbt_validate_edit (std::string&);
|
||||||
bool minsec_validate_edit (const std::string&);
|
bool minsec_validate_edit (const std::string&);
|
||||||
|
|
||||||
samplepos_t samples_from_timecode_string (const std::string&) const;
|
samplepos_t samples_from_timecode_string (const std::string&) const;
|
||||||
samplepos_t samples_from_bbt_string (samplepos_t, const std::string&) const;
|
samplepos_t samples_from_bbt_string (Temporal::timepos_t const &, const std::string&) const;
|
||||||
samplepos_t sample_duration_from_bbt_string (samplepos_t, const std::string&) const;
|
samplepos_t sample_duration_from_bbt_string (Temporal::timepos_t const &, const std::string&) const;
|
||||||
samplepos_t samples_from_minsec_string (const std::string&) const;
|
samplepos_t samples_from_minsec_string (const std::string&) const;
|
||||||
samplepos_t samples_from_seconds_string (const std::string&) const;
|
samplepos_t samples_from_seconds_string (const std::string&) const;
|
||||||
samplepos_t samples_from_audiosamples_string (const std::string&) const;
|
samplepos_t samples_from_audiosamples_string (const std::string&) const;
|
||||||
|
@ -254,13 +253,13 @@ class AudioClock : public CairoWidget, public ARDOUR::SessionHandlePtr
|
||||||
void end_edit (bool);
|
void end_edit (bool);
|
||||||
void end_edit_relative (bool);
|
void end_edit_relative (bool);
|
||||||
void edit_next_field ();
|
void edit_next_field ();
|
||||||
ARDOUR::samplecnt_t parse_as_distance (const std::string&);
|
|
||||||
|
|
||||||
ARDOUR::samplecnt_t parse_as_timecode_distance (const std::string&);
|
Temporal::timecnt_t parse_as_distance (const std::string&);
|
||||||
ARDOUR::samplecnt_t parse_as_minsec_distance (const std::string&);
|
Temporal::timecnt_t parse_as_timecode_distance (const std::string&);
|
||||||
ARDOUR::samplecnt_t parse_as_bbt_distance (const std::string&);
|
Temporal::timecnt_t parse_as_minsec_distance (const std::string&);
|
||||||
ARDOUR::samplecnt_t parse_as_seconds_distance (const std::string&);
|
Temporal::timecnt_t parse_as_bbt_distance (const std::string&);
|
||||||
ARDOUR::samplecnt_t parse_as_samples_distance (const std::string&);
|
Temporal::timecnt_t parse_as_seconds_distance (const std::string&);
|
||||||
|
Temporal::timecnt_t parse_as_samples_distance (const std::string&);
|
||||||
|
|
||||||
void set_colors ();
|
void set_colors ();
|
||||||
void show_edit_status (int length);
|
void show_edit_status (int length);
|
||||||
|
|
|
@ -427,9 +427,9 @@ public:
|
||||||
void reset_zoom (samplecnt_t);
|
void reset_zoom (samplecnt_t);
|
||||||
void reposition_and_zoom (samplepos_t, double);
|
void reposition_and_zoom (samplepos_t, double);
|
||||||
|
|
||||||
samplepos_t get_preferred_edit_position (Editing::EditIgnoreOption = Editing::EDIT_IGNORE_NONE,
|
Temporal::timepos_t get_preferred_edit_position (Editing::EditIgnoreOption = Editing::EDIT_IGNORE_NONE,
|
||||||
bool use_context_click = false,
|
bool use_context_click = false,
|
||||||
bool from_outside_canvas = false);
|
bool from_outside_canvas = false);
|
||||||
|
|
||||||
bool update_mouse_speed ();
|
bool update_mouse_speed ();
|
||||||
bool decelerate_mouse_speed ();
|
bool decelerate_mouse_speed ();
|
||||||
|
@ -569,10 +569,10 @@ public:
|
||||||
void metric_get_minsec (std::vector<ArdourCanvas::Ruler::Mark>&, gdouble, gdouble, gint);
|
void metric_get_minsec (std::vector<ArdourCanvas::Ruler::Mark>&, gdouble, gdouble, gint);
|
||||||
|
|
||||||
/* editing operations that need to be public */
|
/* editing operations that need to be public */
|
||||||
void mouse_add_new_marker (samplepos_t where, bool is_cd=false);
|
void mouse_add_new_marker (Temporal::timepos_t const & where, bool is_cd=false);
|
||||||
void split_regions_at (ARDOUR::MusicSample, RegionSelection&);
|
void split_regions_at (Temporal::timepos_t const & , RegionSelection&);
|
||||||
void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret, bool select_new = false);
|
void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret, bool select_new = false);
|
||||||
RegionSelection get_regions_from_selection_and_mouse (samplepos_t);
|
RegionSelection get_regions_from_selection_and_mouse (Temporal::timepos_t const &);
|
||||||
void do_remove_gaps ();
|
void do_remove_gaps ();
|
||||||
void remove_gaps (samplecnt_t threshold, samplecnt_t leave, bool markers_too);
|
void remove_gaps (samplecnt_t threshold, samplecnt_t leave, bool markers_too);
|
||||||
|
|
||||||
|
@ -1522,7 +1522,7 @@ private:
|
||||||
void set_selection_from_loop ();
|
void set_selection_from_loop ();
|
||||||
void set_selection_from_region ();
|
void set_selection_from_region ();
|
||||||
|
|
||||||
void add_location_mark (samplepos_t where);
|
void add_location_mark (Temporal::timepos_t const & where);
|
||||||
void add_location_from_region ();
|
void add_location_from_region ();
|
||||||
void add_locations_from_region ();
|
void add_locations_from_region ();
|
||||||
void add_location_from_selection ();
|
void add_location_from_selection ();
|
||||||
|
@ -1537,8 +1537,8 @@ private:
|
||||||
|
|
||||||
void set_loop_from_region (bool play);
|
void set_loop_from_region (bool play);
|
||||||
|
|
||||||
void set_loop_range (samplepos_t start, samplepos_t end, std::string cmd);
|
void set_loop_range (Temporal::timepos_t const & start, Temporal::timepos_t const & end, std::string cmd);
|
||||||
void set_punch_range (samplepos_t start, samplepos_t end, std::string cmd);
|
void set_punch_range (Temporal::timepos_t const & start, Temporal::timepos_t const & end, std::string cmd);
|
||||||
|
|
||||||
void toggle_location_at_playhead_cursor ();
|
void toggle_location_at_playhead_cursor ();
|
||||||
void add_location_from_playhead_cursor ();
|
void add_location_from_playhead_cursor ();
|
||||||
|
@ -2230,10 +2230,10 @@ private:
|
||||||
|
|
||||||
void selected_marker_moved (ARDOUR::Location*);
|
void selected_marker_moved (ARDOUR::Location*);
|
||||||
|
|
||||||
bool get_edit_op_range (samplepos_t& start, samplepos_t& end) const;
|
bool get_edit_op_range (Temporal::timepos_t& start, samplepos_t& end) const;
|
||||||
|
|
||||||
void get_regions_at (RegionSelection&, samplepos_t where, const TrackViewList& ts) const;
|
void get_regions_at (RegionSelection&, Temporal::timepos_t const & where, const TrackViewList& ts) const;
|
||||||
void get_regions_after (RegionSelection&, samplepos_t where, const TrackViewList& ts) const;
|
void get_regions_after (RegionSelection&, Temporal::timepos_t const & where, const TrackViewList& ts) const;
|
||||||
|
|
||||||
RegionSelection get_regions_from_selection_and_edit_point (Editing::EditIgnoreOption = Editing::EDIT_IGNORE_NONE,
|
RegionSelection get_regions_from_selection_and_edit_point (Editing::EditIgnoreOption = Editing::EDIT_IGNORE_NONE,
|
||||||
bool use_context_click = false,
|
bool use_context_click = false,
|
||||||
|
|
|
@ -668,7 +668,7 @@ Editor::LocationMarkers::setup_lines ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::mouse_add_new_marker (samplepos_t where, bool is_cd)
|
Editor::mouse_add_new_marker (timepos_t const & where, bool is_cd)
|
||||||
{
|
{
|
||||||
string markername;
|
string markername;
|
||||||
int flags = (is_cd ? Location::IsCDMarker|Location::IsMark : Location::IsMark);
|
int flags = (is_cd ? Location::IsCDMarker|Location::IsMark : Location::IsMark);
|
||||||
|
@ -712,7 +712,7 @@ Editor::mouse_add_new_loop (samplepos_t where)
|
||||||
|
|
||||||
samplepos_t const end = where + current_page_samples() / 8;
|
samplepos_t const end = where + current_page_samples() / 8;
|
||||||
|
|
||||||
set_loop_range (where, end, _("set loop range"));
|
set_loop_range (timepos_t (where), timepos_t (end), _("set loop range"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -728,7 +728,7 @@ Editor::mouse_add_new_punch (samplepos_t where)
|
||||||
|
|
||||||
samplepos_t const end = where + current_page_samples() / 8;
|
samplepos_t const end = where + current_page_samples() / 8;
|
||||||
|
|
||||||
set_punch_range (where, end, _("set punch range"));
|
set_punch_range (timepos_t (where), timepos_t (end), _("set punch range"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1421,7 +1421,7 @@ Editor::marker_menu_loop_range ()
|
||||||
if ((l = find_location_from_marker (marker, is_start)) != 0) {
|
if ((l = find_location_from_marker (marker, is_start)) != 0) {
|
||||||
if (l != transport_loop_location()) {
|
if (l != transport_loop_location()) {
|
||||||
cerr << "Set loop\n";
|
cerr << "Set loop\n";
|
||||||
set_loop_range (l->start().samples(), l->end().samples(), _("loop range from marker"));
|
set_loop_range (l->start(), l->end(), _("loop range from marker"));
|
||||||
} else {
|
} else {
|
||||||
cerr << " at TL\n";
|
cerr << " at TL\n";
|
||||||
}
|
}
|
||||||
|
@ -1442,9 +1442,9 @@ Editor::marker_menu_zoom_to_range ()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
timecnt_t const extra = l->length() * Temporal::ratio_t (5, 100);
|
timepos_t const extra = timepos_t (l->length() * Temporal::ratio_t (5, 100));
|
||||||
timepos_t a = l->start ();
|
timepos_t a = l->start ();
|
||||||
if (a >= timepos_t (extra)) {
|
if (a >= extra) {
|
||||||
a.shift_earlier (extra);
|
a.shift_earlier (extra);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1750,8 +1750,8 @@ Editor::update_loop_range_view ()
|
||||||
|
|
||||||
if (_session->get_play_loop() && ((tll = transport_loop_location()) != 0)) {
|
if (_session->get_play_loop() && ((tll = transport_loop_location()) != 0)) {
|
||||||
|
|
||||||
double x1 = sample_to_pixel (tll->start());
|
double x1 = sample_to_pixel (tll->start_sample());
|
||||||
double x2 = sample_to_pixel (tll->end());
|
double x2 = sample_to_pixel (tll->end_sample());
|
||||||
|
|
||||||
transport_loop_range_rect->set_x0 (x1);
|
transport_loop_range_rect->set_x0 (x1);
|
||||||
transport_loop_range_rect->set_x1 (x2);
|
transport_loop_range_rect->set_x1 (x2);
|
||||||
|
@ -1778,12 +1778,12 @@ Editor::update_punch_range_view ()
|
||||||
double pixel_end;
|
double pixel_end;
|
||||||
|
|
||||||
if (_session->config.get_punch_in()) {
|
if (_session->config.get_punch_in()) {
|
||||||
pixel_start = sample_to_pixel (tpl->start());
|
pixel_start = sample_to_pixel (tpl->start_sample());
|
||||||
} else {
|
} else {
|
||||||
pixel_start = 0;
|
pixel_start = 0;
|
||||||
}
|
}
|
||||||
if (_session->config.get_punch_out()) {
|
if (_session->config.get_punch_out()) {
|
||||||
pixel_end = sample_to_pixel (tpl->end());
|
pixel_end = sample_to_pixel (tpl->end_sample());
|
||||||
} else {
|
} else {
|
||||||
pixel_end = sample_to_pixel (max_samplepos);
|
pixel_end = sample_to_pixel (max_samplepos);
|
||||||
}
|
}
|
||||||
|
@ -1836,7 +1836,7 @@ Editor::goto_nth_marker (int n)
|
||||||
for (Locations::LocationList::iterator i = ordered.begin(); n >= 0 && i != ordered.end(); ++i) {
|
for (Locations::LocationList::iterator i = ordered.begin(); n >= 0 && i != ordered.end(); ++i) {
|
||||||
if ((*i)->is_mark() && !(*i)->is_hidden() && !(*i)->is_session_range()) {
|
if ((*i)->is_mark() && !(*i)->is_hidden() && !(*i)->is_session_range()) {
|
||||||
if (n == 0) {
|
if (n == 0) {
|
||||||
_session->request_locate ((*i)->start());
|
_session->request_locate ((*i)->start_sample());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
--n;
|
--n;
|
||||||
|
@ -1866,10 +1866,10 @@ Editor::toggle_marker_menu_glue ()
|
||||||
begin_reversible_command (_("change marker lock style"));
|
begin_reversible_command (_("change marker lock style"));
|
||||||
XMLNode &before = _session->locations()->get_state();
|
XMLNode &before = _session->locations()->get_state();
|
||||||
|
|
||||||
if (loc->position_lock_style() == MusicTime) {
|
if (loc->position_time_domain() == Temporal::BeatTime) {
|
||||||
loc->set_position_lock_style (AudioTime);
|
loc->set_position_time_domain (Temporal::AudioTime);
|
||||||
} else {
|
} else {
|
||||||
loc->set_position_lock_style (MusicTime);
|
loc->set_position_time_domain (Temporal::BeatTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
XMLNode &after = _session->locations()->get_state();
|
XMLNode &after = _session->locations()->get_state();
|
||||||
|
|
|
@ -436,10 +436,9 @@ LoudnessDialog::analyze ()
|
||||||
/* These are ensured in Editor::measure_master_loudness () */
|
/* These are ensured in Editor::measure_master_loudness () */
|
||||||
assert (_session->master_out ());
|
assert (_session->master_out ());
|
||||||
assert (_session->master_volume ());
|
assert (_session->master_volume ());
|
||||||
assert (_session->master_out ()->output ());
|
assert (_session->master_out()->output());
|
||||||
assert (_session->master_out ()->output ()->n_ports ().n_audio () == 2);
|
assert (_session->master_out()->output()->n_ports().n_audio() == 2);
|
||||||
assert (_range.start < _range.end);
|
assert (_range.start() < _range.end());
|
||||||
|
|
||||||
|
|
||||||
ExportTimespanPtr tsp = _session->get_export_handler ()->add_timespan ();
|
ExportTimespanPtr tsp = _session->get_export_handler ()->add_timespan ();
|
||||||
|
|
||||||
|
@ -458,7 +457,7 @@ LoudnessDialog::analyze ()
|
||||||
fmp->set_analyse (true);
|
fmp->set_analyse (true);
|
||||||
|
|
||||||
/* setup range */
|
/* setup range */
|
||||||
tsp->set_range (_range.start, _range.end);
|
tsp->set_range (_range.start().samples(), _range.end().samples());
|
||||||
tsp->set_range_id ("selection");
|
tsp->set_range_id ("selection");
|
||||||
tsp->set_realtime (_rt_analysis_button.get_active ());
|
tsp->set_realtime (_rt_analysis_button.get_active ());
|
||||||
tsp->set_name ("master");
|
tsp->set_name ("master");
|
||||||
|
|
|
@ -105,7 +105,7 @@ MainClock::absolute_time () const
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MainClock::set (samplepos_t when, bool force, ARDOUR::samplecnt_t /*offset*/)
|
MainClock::set (timepos_t const & when, bool force, timecnt_t const & /*offset*/)
|
||||||
{
|
{
|
||||||
ClockDeltaMode mode;
|
ClockDeltaMode mode;
|
||||||
if (_primary) {
|
if (_primary) {
|
||||||
|
|
|
@ -31,7 +31,7 @@ public:
|
||||||
MainClock (const std::string& clock_name, const std::string& widget_name, bool primary);
|
MainClock (const std::string& clock_name, const std::string& widget_name, bool primary);
|
||||||
samplepos_t absolute_time () const;
|
samplepos_t absolute_time () const;
|
||||||
void set_session (ARDOUR::Session *s);
|
void set_session (ARDOUR::Session *s);
|
||||||
void set (samplepos_t, bool force = false, ARDOUR::samplecnt_t offset = 0);
|
void set (Temporal::timepos_t const &, bool force = false, Temporal::timecnt_t const & offset = Temporal::timecnt_t ());
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -229,11 +229,11 @@ public:
|
||||||
virtual void trigger_script (int nth) = 0;
|
virtual void trigger_script (int nth) = 0;
|
||||||
virtual void add_location_from_playhead_cursor () = 0;
|
virtual void add_location_from_playhead_cursor () = 0;
|
||||||
virtual void remove_location_at_playhead_cursor () = 0;
|
virtual void remove_location_at_playhead_cursor () = 0;
|
||||||
virtual void add_location_mark (samplepos_t where) = 0;
|
virtual void add_location_mark (Temporal::timepos_t const & where) = 0;
|
||||||
virtual void update_grid () = 0;
|
virtual void update_grid () = 0;
|
||||||
virtual void remove_tracks () = 0;
|
virtual void remove_tracks () = 0;
|
||||||
virtual void set_loop_range (samplepos_t start, samplepos_t end, std::string cmd) = 0;
|
virtual void set_loop_range (Temporal::timepos_t const & start, Temporal::timepos_t const & end, std::string cmd) = 0;
|
||||||
virtual void set_punch_range (samplepos_t start, samplepos_t end, std::string cmd) = 0;
|
virtual void set_punch_range (Temporal::timepos_t const & start, Temporal::timepos_t const & end, std::string cmd) = 0;
|
||||||
|
|
||||||
virtual void jump_forward_to_mark () = 0;
|
virtual void jump_forward_to_mark () = 0;
|
||||||
virtual void jump_backward_to_mark () = 0;
|
virtual void jump_backward_to_mark () = 0;
|
||||||
|
@ -350,11 +350,11 @@ public:
|
||||||
virtual void remove_last_capture () = 0;
|
virtual void remove_last_capture () = 0;
|
||||||
virtual void maximise_editing_space () = 0;
|
virtual void maximise_editing_space () = 0;
|
||||||
virtual void restore_editing_space () = 0;
|
virtual void restore_editing_space () = 0;
|
||||||
virtual samplepos_t get_preferred_edit_position (Editing::EditIgnoreOption = Editing::EDIT_IGNORE_NONE, bool from_context_menu = false, bool from_outside_canvas = false) = 0;
|
virtual Temporal::timepos_t get_preferred_edit_position (Editing::EditIgnoreOption = Editing::EDIT_IGNORE_NONE, bool from_context_menu = false, bool from_outside_canvas = false) = 0;
|
||||||
virtual void toggle_meter_updating() = 0;
|
virtual void toggle_meter_updating() = 0;
|
||||||
virtual void split_regions_at (ARDOUR::MusicSample, RegionSelection&) = 0;
|
virtual void split_regions_at (Temporal::timepos_t const &, RegionSelection&) = 0;
|
||||||
virtual void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret, bool select_new = false) = 0;
|
virtual void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret, bool select_new = false) = 0;
|
||||||
virtual void mouse_add_new_marker (samplepos_t where, bool is_cd=false) = 0;
|
virtual void mouse_add_new_marker (Temporal::timepos_t const & where, bool is_cd=false) = 0;
|
||||||
virtual void foreach_time_axis_view (sigc::slot<void,TimeAxisView&>) = 0;
|
virtual void foreach_time_axis_view (sigc::slot<void,TimeAxisView&>) = 0;
|
||||||
virtual void add_to_idle_resize (TimeAxisView*, int32_t) = 0;
|
virtual void add_to_idle_resize (TimeAxisView*, int32_t) = 0;
|
||||||
virtual Temporal::timecnt_t get_nudge_distance (Temporal::timepos_t const & pos, Temporal::timecnt_t& next) = 0;
|
virtual Temporal::timecnt_t get_nudge_distance (Temporal::timepos_t const & pos, Temporal::timecnt_t& next) = 0;
|
||||||
|
@ -503,9 +503,9 @@ public:
|
||||||
|
|
||||||
virtual void set_snapped_cursor_position (samplepos_t pos) = 0;
|
virtual void set_snapped_cursor_position (samplepos_t pos) = 0;
|
||||||
|
|
||||||
virtual void get_regions_at (RegionSelection &, samplepos_t where, TrackViewList const &) const = 0;
|
virtual void get_regions_at (RegionSelection &, Temporal::timepos_t const & where, TrackViewList const &) const = 0;
|
||||||
virtual void get_regions_after (RegionSelection&, samplepos_t where, const TrackViewList& ts) const = 0;
|
virtual void get_regions_after (RegionSelection&, Temporal::timepos_t const & where, const TrackViewList& ts) const = 0;
|
||||||
virtual RegionSelection get_regions_from_selection_and_mouse (samplepos_t) = 0;
|
virtual RegionSelection get_regions_from_selection_and_mouse (Temporal::timepos_t const &) = 0;
|
||||||
virtual void get_regionviews_by_id (PBD::ID const id, RegionSelection & regions) const = 0;
|
virtual void get_regionviews_by_id (PBD::ID const id, RegionSelection & regions) const = 0;
|
||||||
virtual void get_per_region_note_selection (std::list<std::pair<PBD::ID, std::set<boost::shared_ptr<Evoral::Note<Temporal::Beats> > > > >&) const = 0;
|
virtual void get_per_region_note_selection (std::list<std::pair<PBD::ID, std::set<boost::shared_ptr<Evoral::Note<Temporal::Beats> > > > >&) const = 0;
|
||||||
|
|
||||||
|
|
|
@ -188,7 +188,7 @@ RegionLayeringOrderEditor::refill ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
RegionLayeringOrderEditor::set_context (const string& a_name, Session* s, TimeAxisView* tav, boost::shared_ptr<Playlist> pl, samplepos_t pos)
|
RegionLayeringOrderEditor::set_context (const string& a_name, Session* s, TimeAxisView* tav, boost::shared_ptr<Playlist> pl, timepos_t const & pos)
|
||||||
{
|
{
|
||||||
track_name_label.set_text (a_name);
|
track_name_label.set_text (a_name);
|
||||||
|
|
||||||
|
|
|
@ -44,14 +44,14 @@ public:
|
||||||
RegionLayeringOrderEditor (PublicEditor&);
|
RegionLayeringOrderEditor (PublicEditor&);
|
||||||
virtual ~RegionLayeringOrderEditor ();
|
virtual ~RegionLayeringOrderEditor ();
|
||||||
|
|
||||||
void set_context (const std::string &, ARDOUR::Session *, TimeAxisView *, boost::shared_ptr<ARDOUR::Playlist>, ARDOUR::samplepos_t);
|
void set_context (const std::string &, ARDOUR::Session *, TimeAxisView *, boost::shared_ptr<ARDOUR::Playlist>, Temporal::timepos_t const &);
|
||||||
void maybe_present ();
|
void maybe_present ();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool on_key_press_event (GdkEventKey* event);
|
virtual bool on_key_press_event (GdkEventKey* event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
samplepos_t position;
|
Temporal::timepos_t position;
|
||||||
bool in_row_change;
|
bool in_row_change;
|
||||||
uint32_t regions_at_position;
|
uint32_t regions_at_position;
|
||||||
|
|
||||||
|
|
|
@ -206,7 +206,7 @@ RegionSelection::add_to_layer (RegionView * rv)
|
||||||
|
|
||||||
struct RegionSortByTime {
|
struct RegionSortByTime {
|
||||||
bool operator() (const RegionView* a, const RegionView* b) const {
|
bool operator() (const RegionView* a, const RegionView* b) const {
|
||||||
return a->region()->position() < b->region()->position();
|
return a->region()->nt_position() < b->region()->nt_position();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -235,7 +235,7 @@ struct RegionSortByTrack {
|
||||||
/* really, track and position */
|
/* really, track and position */
|
||||||
|
|
||||||
if (a->get_time_axis_view().order() == b->get_time_axis_view().order()) {
|
if (a->get_time_axis_view().order() == b->get_time_axis_view().order()) {
|
||||||
return a->region()->position() < b->region()->position();
|
return a->region()->nt_position() < b->region()->nt_position();
|
||||||
} else {
|
} else {
|
||||||
return a->get_time_axis_view().order() < b->get_time_axis_view().order();
|
return a->get_time_axis_view().order() < b->get_time_axis_view().order();
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ using namespace PBD;
|
||||||
using namespace Gtk;
|
using namespace Gtk;
|
||||||
using namespace Gtkmm2ext;
|
using namespace Gtkmm2ext;
|
||||||
|
|
||||||
TimeFXDialog::TimeFXDialog (Editor& e, bool pitch, samplecnt_t oldlen, samplecnt_t new_length, samplepos_t position)
|
TimeFXDialog::TimeFXDialog (Editor& e, bool pitch, timecnt_t const & oldlen, timecnt_t const & new_length, timepos_t const & position)
|
||||||
: ArdourDialog (X_("time fx dialog"))
|
: ArdourDialog (X_("time fx dialog"))
|
||||||
, editor (e)
|
, editor (e)
|
||||||
, pitching (pitch)
|
, pitching (pitch)
|
||||||
|
@ -145,9 +145,10 @@ TimeFXDialog::TimeFXDialog (Editor& e, bool pitch, samplecnt_t oldlen, samplecnt
|
||||||
vector<string> strings;
|
vector<string> strings;
|
||||||
duration_clock = manage (new AudioClock (X_("stretch"), true, X_("stretch"), true, false, true, false, true));
|
duration_clock = manage (new AudioClock (X_("stretch"), true, X_("stretch"), true, false, true, false, true));
|
||||||
duration_clock->set_session (e.session());
|
duration_clock->set_session (e.session());
|
||||||
duration_clock->set (new_length, true);
|
duration_clock->set (timepos_t (new_length), true);
|
||||||
duration_clock->set_mode (AudioClock::BBT);
|
duration_clock->set_mode (AudioClock::BBT);
|
||||||
duration_clock->set_bbt_reference (position);
|
#warning NUTEMPO FIXME figure out what we are doing here
|
||||||
|
// duration_clock->set_bbt_reference (position);
|
||||||
|
|
||||||
Gtk::Alignment* clock_align = manage (new Gtk::Alignment);
|
Gtk::Alignment* clock_align = manage (new Gtk::Alignment);
|
||||||
clock_align->add (*duration_clock);
|
clock_align->add (*duration_clock);
|
||||||
|
@ -158,7 +159,7 @@ TimeFXDialog::TimeFXDialog (Editor& e, bool pitch, samplecnt_t oldlen, samplecnt
|
||||||
table->attach (*clock_align, 1, 2, row, row+1, Gtk::AttachOptions (Gtk::EXPAND|Gtk::FILL), Gtk::FILL, 0, 0);
|
table->attach (*clock_align, 1, 2, row, row+1, Gtk::AttachOptions (Gtk::EXPAND|Gtk::FILL), Gtk::FILL, 0, 0);
|
||||||
row++;
|
row++;
|
||||||
|
|
||||||
const double fract = ((double) new_length) / original_length;
|
const double fract = (double) (new_length / original_length);
|
||||||
/* note the *100.0 to convert fract into a percentage */
|
/* note the *100.0 to convert fract into a percentage */
|
||||||
duration_adjustment.set_value (fract*100.0);
|
duration_adjustment.set_value (fract*100.0);
|
||||||
Gtk::SpinButton* spinner = manage (new Gtk::SpinButton (duration_adjustment, 1.0, 3));
|
Gtk::SpinButton* spinner = manage (new Gtk::SpinButton (duration_adjustment, 1.0, 3));
|
||||||
|
@ -301,7 +302,7 @@ TimeFXDialog::duration_adjustment_changed ()
|
||||||
|
|
||||||
PBD::Unwinder<bool> uw (ignore_clock_change, true);
|
PBD::Unwinder<bool> uw (ignore_clock_change, true);
|
||||||
|
|
||||||
duration_clock->set ((samplecnt_t) (original_length * (duration_adjustment.get_value()/ 100.0)));
|
duration_clock->set_duration (original_length * Temporal::ratio_t (1.0, (duration_adjustment.get_value() / 100.0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -313,5 +314,5 @@ TimeFXDialog::duration_clock_changed ()
|
||||||
|
|
||||||
PBD::Unwinder<bool> uw (ignore_adjustment_change, true);
|
PBD::Unwinder<bool> uw (ignore_adjustment_change, true);
|
||||||
|
|
||||||
duration_adjustment.set_value (100.0 * (duration_clock->current_duration() / (double) original_length));
|
duration_adjustment.set_value (100.0 * (double) (duration_clock->current_duration() / original_length));
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ class TimeFXDialog : public ArdourDialog, public ProgressReporter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/* We need a position so that BBT mode in the clock can function */
|
/* We need a position so that BBT mode in the clock can function */
|
||||||
TimeFXDialog (Editor& e, bool for_pitch, ARDOUR::samplecnt_t old_length, ARDOUR::samplecnt_t new_length, ARDOUR::samplepos_t position);
|
TimeFXDialog (Editor& e, bool for_pitch, Temporal::timecnt_t const & old_length, Temporal::timecnt_t const & new_length, Temporal::timepos_t const & position);
|
||||||
|
|
||||||
ARDOUR::TimeFXRequest request;
|
ARDOUR::TimeFXRequest request;
|
||||||
Editor& editor;
|
Editor& editor;
|
||||||
|
@ -86,7 +86,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ARDOUR::samplecnt_t original_length;
|
Temporal::timecnt_t original_length;
|
||||||
Gtk::Adjustment pitch_octave_adjustment;
|
Gtk::Adjustment pitch_octave_adjustment;
|
||||||
Gtk::Adjustment pitch_semitone_adjustment;
|
Gtk::Adjustment pitch_semitone_adjustment;
|
||||||
Gtk::Adjustment pitch_cent_adjustment;
|
Gtk::Adjustment pitch_cent_adjustment;
|
||||||
|
|
|
@ -106,12 +106,12 @@ TransportControlProvider::TransportControllable::get_value () const
|
||||||
return (!_session->transport_rolling() ? 1.0 : 0.0);
|
return (!_session->transport_rolling() ? 1.0 : 0.0);
|
||||||
case GotoStart:
|
case GotoStart:
|
||||||
if ((rloc = _session->locations()->session_range_location()) != 0) {
|
if ((rloc = _session->locations()->session_range_location()) != 0) {
|
||||||
return (_session->transport_sample() == rloc->start() ? 1.0 : 0.0);
|
return (_session->transport_sample() == rloc->start_sample() ? 1.0 : 0.0);
|
||||||
}
|
}
|
||||||
return 0.0;
|
return 0.0;
|
||||||
case GotoEnd:
|
case GotoEnd:
|
||||||
if ((rloc = _session->locations()->session_range_location()) != 0) {
|
if ((rloc = _session->locations()->session_range_location()) != 0) {
|
||||||
return (_session->transport_sample() == rloc->end() ? 1.0 : 0.0);
|
return (_session->transport_sample() == rloc->end_sample() ? 1.0 : 0.0);
|
||||||
}
|
}
|
||||||
return 0.0;
|
return 0.0;
|
||||||
case AutoLoop:
|
case AutoLoop:
|
||||||
|
|
Loading…
Reference in New Issue