summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-03-21 15:27:57 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-03-21 15:27:57 +0000
commiteb3fc0d966626aacae113a225cb6175614418a40 (patch)
tree4af47226c5ff226a89380f12b81016e09b0f3693 /libs
parenta873bbb14e5f60afac6a2fb38be447d5b00e1c10 (diff)
add crossfade and layering options to menu system; add missing crossfade editor curve image; add control for destructive recording xfade; remove dead options from options editor
git-svn-id: svn://localhost/trunk/ardour2@411 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/configuration.h8
-rw-r--r--libs/ardour/ardour/destructive_filesource.h3
-rw-r--r--libs/ardour/configuration.cc32
-rw-r--r--libs/ardour/destructive_filesource.cc10
-rw-r--r--libs/ardour/session_state.cc8
5 files changed, 35 insertions, 26 deletions
diff --git a/libs/ardour/ardour/configuration.h b/libs/ardour/ardour/configuration.h
index 7fe3b31232..e61fe29f31 100644
--- a/libs/ardour/ardour/configuration.h
+++ b/libs/ardour/ardour/configuration.h
@@ -164,8 +164,8 @@ class Configuration : public Stateful
gain_t get_quieten_at_speed ();
void set_quieten_at_speed (gain_t);
- std::string get_tape_dir ();
- void set_tape_dir (std::string);
+ uint32_t get_destructive_xfade_msecs ();
+ void set_destructive_xfade_msecs (uint32_t, jack_nframes_t sample_rate = 0);
private:
void set_defaults ();
@@ -246,8 +246,8 @@ class Configuration : public Stateful
bool midi_feedback_interval_ms_is_user;
bool latched_record_enable;
bool latched_record_enable_is_user;
- std::string tape_dir;
- bool tape_dir_is_user;
+ uint32_t destructive_xfade_msecs;
+ bool destructive_xfade_msecs_is_user;
XMLNode *key_node;
bool user_configuration;
diff --git a/libs/ardour/ardour/destructive_filesource.h b/libs/ardour/ardour/destructive_filesource.h
index c8fa3d1798..dbaf379257 100644
--- a/libs/ardour/ardour/destructive_filesource.h
+++ b/libs/ardour/ardour/destructive_filesource.h
@@ -45,11 +45,12 @@ class DestructiveFileSource : public FileSource {
XMLNode& get_state ();
+ static void setup_standard_crossfades (jack_nframes_t sample_rate);
+
private:
static jack_nframes_t xfade_frames;
static gain_t* out_coefficient;
static gain_t* in_coefficient;
- static void setup_standard_crossfades (jack_nframes_t sample_rate);
bool _capture_start;
bool _capture_end;
diff --git a/libs/ardour/configuration.cc b/libs/ardour/configuration.cc
index f73ba1052a..a7fc6b7dd6 100644
--- a/libs/ardour/configuration.cc
+++ b/libs/ardour/configuration.cc
@@ -31,6 +31,7 @@
#include <ardour/ardour.h>
#include <ardour/configuration.h>
#include <ardour/diskstream.h>
+#include <ardour/destructive_filesource.h>
#include "i18n.h"
@@ -262,10 +263,9 @@ Configuration::state (bool user_only)
if (!user_only || latched_record_enable_is_user) {
node->add_child_nocopy(option_node("latched-record-enable", latched_record_enable?"yes":"no"));
}
- if (!user_only || tape_dir_is_user) {
- if (!tape_dir.empty()) {
- node->add_child_nocopy(option_node("tape-dir", tape_dir));
- }
+ if (!user_only || destructive_xfade_msecs_is_user) {
+ snprintf(buf, sizeof(buf), "%" PRIu32, destructive_xfade_msecs);
+ node->add_child_nocopy(option_node("destructive_xfade_msecs", string(buf)));
}
/* use-vst is always per-user */
@@ -409,8 +409,11 @@ Configuration::set_state (const XMLNode& root)
set_midi_feedback_interval_ms (atoi (option_value.c_str()));
} else if (option_name == "latched-record-enable") {
set_latched_record_enable (option_value == "yes");
- } else if (option_name == "tape-dir") {
- set_tape_dir (option_value);
+ } else if (option_name == "destructive_xfade_msecs") {
+ uint32_t v;
+ if (sscanf (option_value.c_str(), "%u", &v) == 1) {
+ set_destructive_xfade_msecs (v);
+ }
}
}
@@ -467,7 +470,7 @@ Configuration::set_defaults ()
timecode_source_is_synced = true;
use_vst = true; /* if we build with VST_SUPPORT, otherwise no effect */
quieten_at_speed = true;
- tape_dir = "";
+ destructive_xfade_msecs = 2;
midi_feedback_interval_ms = 100;
@@ -508,7 +511,7 @@ Configuration::set_defaults ()
quieten_at_speed_is_user = false;
midi_feedback_interval_ms_is_user = false;
latched_record_enable_is_user = false;
- tape_dir_is_user = false;
+ destructive_xfade_msecs_is_user = false;
}
Configuration::MidiPortDescriptor::MidiPortDescriptor (const XMLNode& node)
@@ -1094,14 +1097,17 @@ Configuration::get_latched_record_enable ()
return latched_record_enable;
}
-string
-Configuration::get_tape_dir ()
+uint32_t
+Configuration::get_destructive_xfade_msecs ()
{
- return tape_dir;
+ return destructive_xfade_msecs;
}
void
-Configuration::set_tape_dir (string path)
+Configuration::set_destructive_xfade_msecs (uint32_t msecs, jack_nframes_t rate)
{
- tape_dir = path;
+ destructive_xfade_msecs = msecs;
+ if (rate) {
+ DestructiveFileSource::setup_standard_crossfades (rate);
+ }
}
diff --git a/libs/ardour/destructive_filesource.cc b/libs/ardour/destructive_filesource.cc
index 40138405b6..eaa1242f8c 100644
--- a/libs/ardour/destructive_filesource.cc
+++ b/libs/ardour/destructive_filesource.cc
@@ -102,7 +102,15 @@ DestructiveFileSource::~DestructiveFileSource()
void
DestructiveFileSource::setup_standard_crossfades (jack_nframes_t rate)
{
- xfade_frames = (jack_nframes_t) floor ((/*Config->get_destructive_crossfade_msecs()*/ 64 / 1000.0) * rate);
+ xfade_frames = (jack_nframes_t) floor ((Config->get_destructive_xfade_msecs () / 1000.0) * rate);
+
+ if (out_coefficient) {
+ delete [] out_coefficient;
+ }
+
+ if (in_coefficient) {
+ delete [] in_coefficient;
+ }
out_coefficient = new gain_t[xfade_frames];
in_coefficient = new gain_t[xfade_frames];
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 3bfcb97c70..6a42c0e4d1 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -2255,13 +2255,7 @@ Session::sound_dir () const
string
Session::tape_dir () const
{
- string res = Config->get_tape_dir();
-
- if (!res.empty()) {
- return res;
- }
-
- res = _path;
+ string res = _path;
res += tape_dir_name;
res += '/';
return res;