{
switch(format)
{
- case 8:
- return SND_PCM_FORMAT_S8;
- break;
- case 16:
- return SND_PCM_FORMAT_S16_LE;
- break;
- case 24:
- return SND_PCM_FORMAT_S24_LE;
- break;
- case 32:
- return SND_PCM_FORMAT_S32_LE;
- break;
+ case 8: return SND_PCM_FORMAT_S8;
+ case 16: return SND_PCM_FORMAT_S16_LE;
+ case 24: return SND_PCM_FORMAT_S24_LE;
+ case 32: return SND_PCM_FORMAT_S32_LE;
}
return SND_PCM_FORMAT_UNKNOWN;
}
{
preferences = new Preferences;
preferences->load_defaults(defaults);
- const char *lv2_path = getenv("LV2_PATH");
- if( lv2_path && strcmp(lv2_path, preferences->lv2_path) ) {
- strncpy(preferences->lv2_path, lv2_path, sizeof(preferences->lv2_path));
- remove_plugin_index();
- }
- else if( !lv2_path && preferences->lv2_path[0] ) {
- File::setenv_path("LV2_PATH",preferences->lv2_path, 0);
- }
+ File::setenv_path("LV2_PATH",preferences->lv2_path, 0);
session = new MainSession(this);
session->load_defaults(defaults);
// set x11_host, screens, window_config
samplerate = 44100;
refreshrate = 30.;
+ min_block_length = 1;
block_length = 4096;
midi_buf_size = 8192;
ui_updateRate = uri_table.map(LV2_UI__updateRate);
samplerate = sample_rate;
- block_length = bfrsz;
options.add(param_sampleRate, sizeof(float), atom_float, &samplerate);
- options.add(bufsz_minBlockLength, sizeof(int), atom_int, &block_length);
+ if( min_block_length > bfrsz ) min_block_length = bfrsz;
+ options.add(bufsz_minBlockLength, sizeof(int), atom_int, &min_block_length);
+ block_length = bfrsz;
options.add(bufsz_maxBlockLength, sizeof(int), atom_int, &block_length);
options.add(bufsz_sequenceSize, sizeof(int), atom_int, &midi_buf_size);
options.add(ui_updateRate, sizeof(float), atom_float, &refreshrate);
(lilv_plugin_has_feature(lilv, powerOf2BlockLength) ||
lilv_plugin_has_feature(lilv, fixedBlockLength) ||
lilv_plugin_has_feature(lilv, boundedBlockLength)) ? 4096 : 0;
+ init_buffer(bfrsz);
return 0;
}
LV2_Atom_Sequence seq_in[2];
LV2_Atom_Sequence *seq_out;
float samplerate, refreshrate;
- int block_length, midi_buf_size;
+ int min_block_length, block_length;
+ int midi_buf_size;
LilvInstance *inst;
SuilInstance *sinst;
enum { NO_COMMAND,
LV2_OPEN,
LV2_LOAD,
+ LV2_CONFIG,
LV2_UPDATE,
LV2_SHOW,
LV2_HIDE,
{
int64_t src_position = get_source_position();
KeyFrame *prev_keyframe = get_prev_keyframe(src_position);
+ if( prev_keyframe->is_default ) return 0;
PluginLV2ClientConfig curr_config;
curr_config.copy_from(config);
read_data(prev_keyframe);
load_configuration();
if( config.update() > 0 ) {
gui->update_selected();
- update_lv2();
+ update_lv2(LV2_UPDATE);
}
gui->unlock_window();
}
-void PluginLV2Client::update_lv2()
+void PluginLV2Client::update_lv2(int token)
{
PluginLV2ParentUI *ui = find_ui();
if( !ui ) return;
- ui->send_child(LV2_UPDATE, config.ctls, sizeof(float)*config.nb_ports);
+ ui->send_child(token, config.ctls, sizeof(float)*config.nb_ports);
}
}
int PluginLV2Client::process_realtime(int64_t size,
- Samples *input_ptr, Samples *output_ptr)
-{
- if( load_configuration() )
- update_lv2();
- init_buffer(size);
- load_buffer(size, &input_ptr, 1);
- process_buffer(size);
- return unload_buffer(size, &output_ptr, 1);
+ Samples **input_ptr, Samples **output_ptr, int chs)
+{
+ int64_t pos = get_source_position();
+ int64_t end = pos + size;
+ int64_t samples = 0;
+ while( pos < end ) {
+ KeyFrame *prev_keyframe = get_prev_keyframe(pos);
+ if( !prev_keyframe->is_default ) {
+ read_data(prev_keyframe);
+ update_lv2(LV2_CONFIG);
+ }
+ KeyFrame *next_keyframe = get_next_keyframe(pos);
+ int64_t next_pos = next_keyframe->position;
+ if( pos >= next_pos || next_pos > end )
+ next_pos = end;
+ int64_t len = next_pos - pos;
+ if( len > block_length )
+ len = block_length;
+ if( pos + len > end )
+ len = end - pos;
+ init_buffer(len);
+ for( int i=chs; --i>=0; ) {
+ input_ptr[i]->set_offset(samples);
+ output_ptr[i]->set_offset(samples);
+ }
+ load_buffer(len, input_ptr, chs);
+ process_buffer(len);
+ unload_buffer(len, output_ptr, chs);
+ samples += len;
+ pos += len;
+ }
+ for( int i=chs; --i>=0; )
+ output_ptr[i]->set_offset(0);
+ return samples;
}
int PluginLV2Client::process_realtime(int64_t size,
Samples **input_ptr, Samples **output_ptr)
{
- if( load_configuration() )
- update_lv2();
- init_buffer(size);
- load_buffer(size, input_ptr, PluginClient::total_in_buffers);
- process_buffer(size);
- return unload_buffer(size, output_ptr, PluginClient::total_out_buffers);
+ return process_realtime(size, input_ptr, output_ptr,
+ PluginClient::total_out_buffers);
}
+int PluginLV2Client::process_realtime(int64_t size,
+ Samples *input_ptr, Samples *output_ptr)
+{
+ return process_realtime(size, &input_ptr, &output_ptr, 1);
+}
PluginLV2BlackList::PluginLV2BlackList(const char *path)
{
~PluginLV2Client();
int process_realtime(int64_t size,
- Samples *input_ptr,
- Samples *output_ptr);
+ Samples **input_ptr, Samples **output_ptr, int chs);
int process_realtime(int64_t size,
- Samples **input_ptr,
- Samples **output_ptr);
+ Samples *input_ptr, Samples *output_ptr);
+ int process_realtime(int64_t size,
+ Samples **input_ptr, Samples **output_ptr);
// Update output pointers as well
int is_realtime();
int is_multichannel();
int unload_buffer(int samples, Samples **output, int och);
void process_buffer(int size);
void update_gui();
- void update_lv2();
+ void update_lv2(int token);
int init_lv2();
PluginLV2ParentUI *find_ui();
PluginLV2ParentUI *get_ui();
PluginLV2Client *client = gui->client;
client->config.init_lv2(client->lilv, client);
client->config.update();
- client->update_lv2();
+ client->update_lv2(LV2_LOAD);
gui->update(0);
client->send_configure_change();
return 1;
return !fs_matches && !nrs_matches;
}
+//force= 1:ctls(all),gui(all) 0:changed(ctls) -1:gui(all)
int PluginLV2UI::update_lv2_input(float *vals, int force)
{
int ret = 0;
int idx = config[i]->idx;
float val = vals[idx];
if( !force && ctls[idx] == val ) continue;
- ctls[idx] = val;
- update_control(idx, sizeof(ctls[idx]), 0, &ctls[idx]);
- ++ret;
+ if( force >= 0 ) {
+ ctls[idx] = val;
+ ++ret;
+ }
+ if( force )
+ update_control(idx, sizeof(val), 0, &val);
}
return ret;
}
float *vals = (float *)child_data;
update_lv2_input(vals, 1);
break; }
- case LV2_UPDATE: {
+ case LV2_CONFIG: {
float *vals = (float *)child_data;
update_lv2_input(vals, 0);
break; }
+ case LV2_UPDATE: {
+ float *vals = (float *)child_data;
+ update_lv2_input(vals, -1);
+ break; }
case LV2_SHOW: {
start_gui();
break; }
<tr>
<td height="26" align="right"><font face="Liberation Serif" size=4> </font></td>
<td align="left"><font face="Liberation Serif" size=4>DVD Render…</font></td>
- <td align="left"><font face="Liberation Serif" size=4>'Shift-D'</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>'Alt-d'</font></td>
<td align="left"><font face="Liberation Serif" size=4>Open create dvd disk window</font></td>
</tr>
<tr>
<td align="left"><font face="Liberation Serif" size=4>'d'</font></td>
<td align="left"><font face="Liberation Serif" size=4>Delete last track</font></td>
</tr>
+ <tr>
+ <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Delete first track</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>'Shift-D'</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Delete first track</font></td>
+ </tr>
<tr>
<td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
<td align="left"><font face="Liberation Serif" size=4>Concatenate trks</font></td>