static void RT_process(SoundPlugin *plugin, int64_t time, int num_frames, float **inputs, float **outputs){ const SoundPluginType *type = plugin->type; Data *data = static_cast<Data*>(plugin->data); #if 0 if(!strcmp(type->name,"System Out")){ plugin->system_volume_peak_values = GFX_OS_get_system_volume_peak_pointers(type->num_inputs); printf("%p\n",plugin->system_volume_peak_values); } #endif if(MIXER_is_saving()){ if (GFX_OS_patch_is_system_out((struct Patch*)plugin->patch)) SOUNDFILESAVER_write(inputs, type->num_inputs, num_frames); } for(int ch=0;ch<type->num_inputs;ch++) if (data->output_ports[ch]!=NULL) memcpy(((float*)jack_port_get_buffer(data->output_ports[ch],g_jackblock_size))+g_jackblock_delta_time, inputs[ch], sizeof(float)*num_frames); for(int ch=0;ch<type->num_outputs;ch++) if (data->input_ports[ch]!=NULL) memcpy(outputs[ch], ((float*)jack_port_get_buffer(data->input_ports[ch],g_jackblock_size))+g_jackblock_delta_time, sizeof(float)*num_frames); }
void EditorWidget::wheelEvent(QWheelEvent *qwheelevent){ if(ATOMIC_GET(is_starting_up)==true) return; if (MIXER_is_saving()) return; struct Tracker_Windows *window=static_cast<struct Tracker_Windows*>(root->song->tracker_windows); int num_lines = R_ABS(qwheelevent->delta()/120); //printf(" Got wheel event %d\n",qwheelevent->delta()/120); DO_GFX( { /* if(qwheelevent->delta()<0) ScrollEditorDown(window,num_lines * getScrollMultiplication()); else ScrollEditorUp(window,num_lines * getScrollMultiplication()); */ if (qwheelevent->modifiers() & Qt::ControlModifier) { if (qwheelevent->delta() > 0) zoom(1,window->l.num); else zoom(-1,window->l.num); #if 0 } else if (qwheelevent->modifiers() & Qt::ShiftModifier) { tevent.ID=TR_KEYBOARD; if(qwheelevent->delta()<0) tevent.SubID=EVENT_LEFTARROW; else tevent.SubID=EVENT_RIGHTARROW; for(int i=0;i<num_lines;i++) EventReciever(&tevent,window); #endif } else { tevent.ID=TR_KEYBOARD; if(qwheelevent->delta()<0) tevent.SubID=EVENT_DOWNARROW; else tevent.SubID=EVENT_UPARROW; for(int i=0;i<num_lines;i++) EventReciever(&tevent,window); } });
void BACKUP_call_very_often(void){ if (MIXER_is_saving()) return; if (g_radium_runs_custom_exec) return; static bool has_inited = false; if (has_inited==false){ RT_BACKUP_reset_timer(); has_inited=true; } if (!editor_has_keyboard_focus()) // If showing popup menu, editing text widgets, etc. we don't want to disturb the user. return; if (QApplication::mouseButtons() != Qt::NoButton) // Wait until user doesn't use the mouse. return; static bool is_playing = false; Player_State player_state = ATOMIC_GET(pc->player_state); if (!is_playing && player_state==PLAYER_STATE_PLAYING){ is_playing = true; g_curr_playing_start_time = TIME_get_ms(); } if (is_playing && player_state==PLAYER_STATE_STOPPED){ is_playing = false; double added_playing_duration = TIME_get_ms() - g_curr_playing_start_time; g_curr_playing_duration += added_playing_duration; } if (!doSaveBackupWhilePlaying()) if (is_playing) return; //printf("duration: %f\n",get_unbackuped_duration() / 1000.0); if (SampleRecorder_Get_Num_Instances() > 0) return; if (get_unbackuped_duration() > get_backup_interval_ms()){ make_backup(); RT_BACKUP_reset_timer(); } }