int command = direction == PLAY_REVERSE ?
NORMAL_REWIND : NORMAL_FWD;
if( !nested_command )
- nested_command = new TransportCommand;
+ nested_command = new TransportCommand(get_preferences());
nested_command->command = command;
nested_command->get_edl()->copy_all(nested_edl);
nested_command->change_type = CHANGE_ALL;
processors > 1 ? 2 : 1, 0);
VFrame ***frames = file.get_video_buffer();
VFrame *frame = frames[0][0];
- TransportCommand command;
+ TransportCommand command(preferences);
//command.command = audio_tracks ? NORMAL_FWD : CURRENT_FRAME;
command.command = CURRENT_FRAME;
command.get_edl()->copy_all(edl);
void AssetPicon::open_render_engine(EDL *edl, int is_audio)
{
- TransportCommand command;
+ TransportCommand command(mwindow->preferences);
command.command = is_audio ? NORMAL_FWD : CURRENT_FRAME;
command.get_edl()->copy_all(edl);
command.change_type = CHANGE_ALL;
PackageDispatcher *packages = new PackageDispatcher;
// Load EDL
- TransportCommand *command = new TransportCommand;
+ TransportCommand *command = new TransportCommand(preferences);
FileXML *file = new FileXML;
file->read_from_file(job->edl_path);
asset->sample_rate = ref->get_sample_rate();
asset->audio_length = asset->audio_data ? ref->get_audio_samples() : 0;
strcpy(asset->acodec, "REF");
- command = new TransportCommand();
+ command = new TransportCommand(file->preferences);
command->reset();
command->get_edl()->copy_all(ref);
command->command = NORMAL_FWD;
}
else
{
- TransportCommand command;
+ TransportCommand command(mwindow->preferences);
command.command = NORMAL_FWD;
command.get_edl()->copy_all((EDL*)indexable);
command.change_type = CHANGE_ALL;
MixersAlignARender::MixersAlignARender(MWindow *mwindow, EDL *edl)
: RenderEngine(0, mwindow->preferences, 0, 0)
{
- TransportCommand command;
+ TransportCommand command(mwindow->preferences);
command.command = NORMAL_FWD;
command.get_edl()->copy_all(edl);
command.change_type = CHANGE_ALL;
//printf("PackageRenderer::initialize %d\n", preferences->processors);
- command = new TransportCommand;
+ command = new TransportCommand(preferences);
command->command = NORMAL_FWD;
command->get_edl()->copy_all(edl);
command->change_type = CHANGE_ALL;
tracking_active = 0;
audio_cache = 0;
video_cache = 0;
- command = new TransportCommand();
+ command = new TransportCommand(mwindow->preferences);
command->command = STOP;
- next_command = new TransportCommand();
+ next_command = new TransportCommand(mwindow->preferences);
next_command->change_type = CHANGE_ALL;
- stop_command = new TransportCommand();
+ stop_command = new TransportCommand(mwindow->preferences);
stop_command->command = STOP;
stop_command->realtime = 1;
- sent_command = new TransportCommand();
+ sent_command = new TransportCommand(mwindow->preferences);
sent_command->command = -1;
send_active = 0;
tracking_lock = new Mutex("PlaybackEngine::tracking_lock");
android_remote = 0;
android_port = 23432;
strcpy(android_pin, "cinelerra");
+
+ fast_speed = 2.0;
+ slow_speed = 0.5;
memset(channel_positions, 0, sizeof(channel_positions));
int channels = 0;
android_remote = that->android_remote;
android_port = that->android_port;
strcpy(android_pin, that->android_pin);
+
+ slow_speed = that->slow_speed;
+ fast_speed = that->fast_speed;
+
this->shbtn_prefs.remove_all_objects();
for( int i=0; i<that->shbtn_prefs.size(); ++i )
this->shbtn_prefs.append(new ShBtnPref(*that->shbtn_prefs[i]));
scan_commercials = defaults->get("SCAN_COMMERCIALS", scan_commercials);
android_remote = defaults->get("ANDROID_REMOTE", android_remote);
android_port = defaults->get("ANDROID_PORT", android_port);
+ fast_speed = defaults->get("FAST_SPEED", fast_speed);
+ slow_speed = defaults->get("SLOW_SPEED", slow_speed);
defaults->get("ANDROID_PIN", android_pin);
defaults->get("INDEX_DIRECTORY", index_directory);
index_size = defaults->get("INDEX_SIZE", index_size);
defaults->update("ANDROID_REMOTE", android_remote);
defaults->update("ANDROID_PIN", android_pin);
defaults->update("ANDROID_PORT", android_port);
-
+ defaults->update("SLOW_SPEED", slow_speed);
+ defaults->update("FAST_SPEED", fast_speed);
defaults->update("CACHE_SIZE", cache_size);
defaults->update("CACHE_TRANSITIONS", cache_transitions);
defaults->update("INDEX_DIRECTORY", index_directory);
ArrayList<ShBtnPref *> shbtn_prefs;
// file open probe order
ArrayList<ProbePref *> file_probes;
+// fast/slow forward and backward speeds, default 2.0/0.5
+ float fast_speed;
+ float slow_speed;
// ====================================== Plugin Set ==============================
char plugin_dir[BCTEXTLEN];
result = 1;
}
else {
- TransportCommand command;
+ TransportCommand command(preferences);
command.command = CURRENT_FRAME;
command.get_edl()->copy_all((EDL *)orig);
command.change_type = CHANGE_ALL;
render->result = 0;
// Create rendering command
- TransportCommand *command = new TransportCommand;
+ TransportCommand *command = new TransportCommand(mwindow->preferences);
command->command = NORMAL_FWD;
command->get_edl()->copy_all(edl);
command->change_type = CHANGE_ALL;
do_video = 0;
interrupted = 0;
this->preferences = new Preferences;
- this->command = new TransportCommand;
+ this->command = new TransportCommand(preferences);
this->preferences->copy_from(preferences);
edl = 0;
}
if( !mwindow->gui->render_engine ) {
- TransportCommand command;
+ TransportCommand command(mwindow->preferences);
command.command = NORMAL_FWD;
command.get_edl()->copy_all(edit->nested_edl);
command.change_type = CHANGE_ALL;
if( !render_engine ) {
MWindow *mwindow = resource_thread->mwindow;
- TransportCommand command;
+ TransportCommand command(mwindow->preferences);
command.command = do_audio ? NORMAL_FWD : CURRENT_FRAME;
command.get_edl()->copy_all(nested_edl);
command.change_type = CHANGE_ALL;
case 0: {
VFrame vlt(edl->get_w(), edl->get_h(), edl->session->color_model);
VFrame vrt(edl->get_w(), edl->get_h(), edl->session->color_model);
- TransportCommand command;
+ TransportCommand command(mwindow->preferences);
command.command = CURRENT_FRAME;
command.get_edl()->copy_all((EDL *)edl);
command.change_type = CHANGE_ALL;
#include "edlsession.h"
#include "localsession.h"
#include "playbackengine.h"
+#include "preferences.h"
#include "tracks.h"
#include "transportque.h"
-TransportCommand::TransportCommand()
+
+TransportCommand::TransportCommand(Preferences *preferences)
{
// In rendering we want a master EDL so settings don't get clobbered
// in the middle of a job.
edl->create_objects();
command = 0;
change_type = 0;
+ this->preferences = preferences;
reset();
}
float TransportCommand::get_speed(int command, float speed)
{
+// fast = 2.0, slow = 0.5
+// float my_fast_speed = 2.0;
+// float my_slow_speed = 0.5;
+float my_fast_speed = preferences->fast_speed;
+float my_slow_speed = preferences->slow_speed;
+
switch(command) {
case SLOW_FWD:
case SLOW_REWIND:
- return speed ? speed : 0.5;
+ return speed ? speed : my_slow_speed;
case NORMAL_FWD:
case NORMAL_REWIND:
case FAST_FWD:
case FAST_REWIND:
- return speed ? speed : 2.;
+ return speed ? speed : my_fast_speed;
}
return 0.;
#include "condition.inc"
#include "edl.inc"
#include "playbackengine.inc"
+#include "preferences.inc"
#include "transportque.inc"
class TransportCommand
{
public:
- TransportCommand();
+ TransportCommand(Preferences *preferences);
~TransportCommand();
void reset();
void set_playback_range(EDL *edl, int use_inout, int do_displacement);
static int single_frame(int command);
static int get_direction(int command);
- static float get_speed(int command, float speed=0);
+ float get_speed(int command, float speed=0);
// Adjust playback range with in/out points for rendering
void playback_range_adjust_inout();
private:
// Copied to render engines
EDL *edl;
+ Preferences *preferences;
};
#endif
nested_renderengine = 0;
}
if( !nested_command )
- nested_command = new TransportCommand;
+ nested_command = new TransportCommand(get_preferences());
nested_command->command = command;
nested_command->get_edl()->copy_all(nested_edl);
nested_command->change_type = CHANGE_ALL;
void VWindowGUI::draw_wave()
{
- TransportCommand command;
+ TransportCommand command(mwindow->preferences);
command.command = NORMAL_FWD;
command.get_edl()->copy_all(vwindow->get_edl());
command.change_type = CHANGE_ALL;
nested_edl->create_objects();
nested_edl->set_path(filename);
nested_edl->load_xml(&xml_file, LOAD_ALL);
- TransportCommand command;
+ TransportCommand command(server->preferences);
//command.command = audio_tracks ? NORMAL_FWD : CURRENT_FRAME;
command.command = CURRENT_FRAME;
command.get_edl()->copy_all(nested_edl);