char string[BCTEXTLEN];
int x0 = mwindow->theme->preferencesoptions_x;
int y0 = mwindow->theme->preferencesoptions_y;
- int x = x0, y = y0, x1 = x + 100, x2 = x + 160;
+ int x = x0, y = y0, x1 = x + 100;
add_subwindow(new BC_Title(x, y, _("Layout:"), LARGEFONT,
resources->text_default));
y += 35;
+ int y1 = y;
ViewTheme *theme;
add_subwindow(new BC_Title(x, y, _("Theme:")));
add_subwindow(plugin_icons = new ViewPluginIcons(x1, y, pwindow));
plugin_icons->create_objects();
y += plugin_icons->get_h() + 15;
+ x1 = get_w()/2;
- add_subwindow(new BC_Title(x, y, _("View Thumbnail size:")));
+ int x2 = x1 + 160, y2 = y;
+ y = y1;
+ add_subwindow(new BC_Title(x1, y, _("View thumbnail size:")));
thumbnail_size = new ViewThumbnailSize(pwindow, this, x2, y);
thumbnail_size->create_objects();
y += thumbnail_size->get_h() + 5;
+ add_subwindow(new BC_Title(x1, y, _("Vicon memory size:")));
+ vicon_size = new ViewViconSize(pwindow, this, x2, y);
+ vicon_size->create_objects();
+ y += vicon_size->get_h() + 5;
+ add_subwindow(new BC_Title(x1, y, _("Vicon color mode:")));
+ add_subwindow(vicon_color_mode = new ViewViconColorMode(pwindow, x2, y));
+ vicon_color_mode->create_objects();
+ y += vicon_color_mode->get_h() + 5;
+ y = bmax(y, y2);
y += 10;
add_subwindow(new BC_Bar(5, y, get_w() - 10));
add_subwindow(new BC_Title(x, y, _("Time Format:"), LARGEFONT,
resources->text_default));
- x1 = get_w()/2;
add_subwindow(new BC_Title(x1, y, _("Flags:"), LARGEFONT,
resources->text_default));
y += get_text_height(LARGEFONT) + 5;
y += 10;
- int y1 = y;
+ y1 = y;
add_subwindow(hms = new TimeFormatHMS(pwindow, this,
pwindow->thread->edl->session->time_format == TIME_HMS,
return 1;
}
+ViewViconSize::ViewViconSize(PreferencesWindow *pwindow,
+ AppearancePrefs *aprefs, int x, int y)
+ : BC_TumbleTextBox(aprefs,
+ pwindow->thread->preferences->vicon_size,
+ 16, 512, x, y, 80)
+
+{
+ this->pwindow = pwindow;
+ this->aprefs = aprefs;
+}
+
+int ViewViconSize::handle_event()
+{
+ int v = atoi(get_text());
+ bclamp(v, 16,512);
+ pwindow->thread->preferences->vicon_size = v;
+ return 1;
+}
+
+ViewViconColorMode::ViewViconColorMode(PreferencesWindow *pwindow, int x, int y)
+ : BC_PopupMenu(x, y, 100,
+ _(vicon_color_modes[pwindow->thread->preferences->vicon_color_mode]), 1)
+{
+ this->pwindow = pwindow;
+}
+ViewViconColorMode::~ViewViconColorMode()
+{
+}
+
+const char *ViewViconColorMode::vicon_color_modes[] = {
+ N_("Low"),
+ N_("Med"),
+ N_("High"),
+};
+
+void ViewViconColorMode::create_objects()
+{
+ for( int id=0,nid=sizeof(vicon_color_modes)/sizeof(vicon_color_modes[0]); id<nid; ++id )
+ add_item(new ViewViconColorModeItem(this, _(vicon_color_modes[id]), id));
+ handle_event();
+}
+
+int ViewViconColorMode::handle_event()
+{
+ set_text(_(vicon_color_modes[pwindow->thread->preferences->vicon_color_mode]));
+ return 1;
+}
+
+ViewViconColorModeItem::ViewViconColorModeItem(ViewViconColorMode *popup, const char *text, int id)
+ : BC_MenuItem(text)
+{
+ this->popup = popup;
+ this->id = id;
+}
+
+int ViewViconColorModeItem::handle_event()
+{
+ popup->set_text(get_text());
+ popup->pwindow->thread->preferences->vicon_color_mode = id;
+ return popup->handle_event();
+}
+
UseTipWindow::UseTipWindow(PreferencesWindow *pwindow, int x, int y)
: BC_CheckBox(x,
int YuvColorSpace::handle_event()
{
- set_text(color_space[pwindow->thread->preferences->yuv_color_space]);
+ set_text(_(color_space[pwindow->thread->preferences->yuv_color_space]));
return 1;
}
TimeFormatSeconds *seconds;
ViewThumbnails *thumbnails;
ViewThumbnailSize *thumbnail_size;
+ ViewViconSize *vicon_size;
+ ViewViconColorMode *vicon_color_mode;
YuvColorSpace *yuv_color_space;
YuvColorRange *yuv_color_range;
};
PreferencesWindow *pwindow;
};
+class ViewViconSize : public BC_TumbleTextBox
+{
+public:
+ ViewViconSize(PreferencesWindow *pwindow,
+ AppearancePrefs *aprefs, int x, int y);
+ int handle_event();
+ AppearancePrefs *aprefs;
+ PreferencesWindow *pwindow;
+};
+
+class ViewViconColorMode : public BC_PopupMenu
+{
+ static const char *vicon_color_modes[3];
+public:
+ ViewViconColorMode(PreferencesWindow *pwindow, int x, int y);
+ ~ViewViconColorMode();
+
+ void create_objects();
+ int handle_event();
+
+ PreferencesWindow *pwindow;
+};
+
+class ViewViconColorModeItem : public BC_MenuItem
+{
+public:
+ ViewViconColorModeItem(ViewViconColorMode *popup, const char *text, int id);
+ int handle_event();
+ ViewViconColorMode *popup;
+ int id;
+};
+
class UseTipWindow : public BC_CheckBox
{
public:
class ViewPluginIconItem;
class ViewThumbnails;
class ViewThumbnailSize;
+class ViewViconSize;
+class ViewViconColorMode;
+class ViewViconModeItem;
class UseTipWindow;
class UseWarnIndecies;
class UseWarnVersion;
class YuvColorSpaceItem;
class YuvColorRange;
class YuvColorRangeItem;
-class PrefsAutostartLV2UI;
class PerpetualSession;
#endif
{
Asset *asset = (Asset *)picon->indexable;
if( !asset->video_data && audio_data && audio_size && length > 0 ) {
- if( !temp ) temp = new VFrame(0, -1, vw, vh, BC_RGB888, -1);
+ if( !temp ) temp = new VFrame(0, -1, w, h, BC_RGB888, -1);
temp->clear_frame();
int sample_rate = asset->get_sample_rate();
int64_t audio_samples = asset->get_audio_samples();
while( i < len ) data[i++] = *audio_data++ * sample_scale;
while( i < bfrsz ) data[i++] = 0;
picon->draw_wave(temp, data, bfrsz, RED, GREEN);
- int x = (vw-1) * line_pos;
+ int x = (w-1) * line_pos;
temp->pixel_rgb = RED;
- temp->draw_line(x,0, x,vh);
+ temp->draw_line(x,0, x,h);
return temp;
}
int vw = picon->gui->vicon_thread->vw;
}
if( !temp )
temp = new VFrame(0, -1, asset->width, asset->height, BC_RGB888, -1);
+ int vicon_cmodel = BC_RGB8;
+ switch( mwindow->preferences->vicon_color_mode ) {
+ case VICON_COLOR_MODE_LOW: vicon_cmodel = BC_RGB8; break;
+ case VICON_COLOR_MODE_MED: vicon_cmodel = BC_RGB565; break;
+ case VICON_COLOR_MODE_HIGH: vicon_cmodel = BC_RGB888; break;
+ }
while( seq_no >= images.size() ) {
mwindow->video_cache->check_in(asset);
Thread::yield();
int64_t pos = images.size() / picon->gui->vicon_thread->refresh_rate * frame_rate;
file->set_video_position(pos,0);
if( file->read_frame(temp) ) temp->clear_frame();
- add_image(temp, vw, vh, BC_RGB8);
+ add_image(temp, vw, vh, vicon_cmodel);
}
mwindow->video_cache->check_in(asset);
}
}
}
mwindow->gui->lock_window("AssetVIcon::popup_button_press");
- edl->local_session->set_selectionstart(pos);
- edl->local_session->set_selectionend(pos);
- mwindow->find_cursor();
- edl->local_session->set_selectionstart(start);
- edl->local_session->set_selectionend(end);
+ if( !shift_down() ) mwindow->select_point(!ctrl_down() ? pos : start);
+ edl->local_session->set_selectionstart(!ctrl_down() ? pos : start);
+ edl->local_session->set_selectionend(!ctrl_down() ? pos : !shift_down() ? start : end);
mwindow->zoom_sample(edl->local_session->zoom_sample);
mwindow->gui->unlock_window();
return 1;
AssetVIconThread::AssetVIconThread(AWindowAssets *asset_list)
: VIconThread(asset_list,
- asset_list->mwindow->preferences->awindow_picon_h * 16/9,
- asset_list->mwindow->preferences->awindow_picon_h,
- 4 * asset_list->mwindow->preferences->awindow_picon_h * 16/9,
- 4 * asset_list->mwindow->preferences->awindow_picon_h)
+ asset_list->mwindow->preferences->vicon_size * 16/9,
+ asset_list->mwindow->preferences->vicon_size,
+ 4*asset_list->mwindow->preferences->awindow_picon_h * 16/9,
+ 4*asset_list->mwindow->preferences->awindow_picon_h)
{
draw_mode = ASSET_DRAW_IMAGE;
}
int vx = viewing->get_vx(), rx = 0;
int vy = viewing->get_vy(), ry = 0;
wdw->get_root_coordinates(vx, vy, &rx, &ry);
- rx += (rx >= cx ? -view_w : viewing->vw);
- ry += (ry >= cy ? -view_h : viewing->vh);
+ rx += (rx >= cx ? -view_w : viewing->w);
+ ry += (ry >= cy ? -view_h : viewing->h);
AssetViewPopup *popup = new AssetViewPopup(this, draw_mode,
frame, rx, ry, view_w, view_h);
if( draw_mode == ASSET_DRAW_MEDIA_MAP )
VFrame *frame = vicon->frame();
if( !frame ) return 0;
if( !vicon_frame )
- vicon_frame = new VFrame(vicon->vw, vicon->vh, frame->get_color_model());
+ vicon_frame = new VFrame(vicon->w, vicon->h, frame->get_color_model());
vicon_frame->transfer_from(frame);
return vicon_frame;
}
trap_sigsegv = 1;
trap_sigintr = 1;
awindow_picon_h = 50;
+ vicon_size = 50;
+ vicon_color_mode = VICON_COLOR_MODE_LOW;
theme[0] = 0;
plugin_icons[0] = 0;
strcpy(snapshot_path, "/tmp");
keyframe_reticle = that->keyframe_reticle;
perpetual_session = that->perpetual_session;
awindow_picon_h = that->awindow_picon_h;
+ vicon_size = that->vicon_size;
+ vicon_color_mode = that->vicon_color_mode;
strcpy(theme, that->theme);
strcpy(plugin_icons, that->plugin_icons);
strcpy(snapshot_path, that->snapshot_path);
trap_sigintr = defaults->get("TRAP_SIGINTR", trap_sigintr);
awindow_picon_h = defaults->get("AWINDOW_PICON_H", awindow_picon_h);
+ vicon_size = defaults->get("VICON_SIZE",vicon_size);
+ vicon_color_mode = defaults->get("VICON_COLOR_MODE",vicon_color_mode);
strcpy(theme, _(DEFAULT_THEME));
strcpy(plugin_icons, DEFAULT_PICON);
defaults->get("THEME", theme);
defaults->update("TRAP_SIGSEGV", trap_sigsegv);
defaults->update("TRAP_SIGINTR", trap_sigintr);
defaults->update("AWINDOW_PICON_H", awindow_picon_h);
+ defaults->update("VICON_SIZE",vicon_size);
+ defaults->update("VICON_COLOR_MODE",vicon_color_mode);
defaults->update("THEME", theme);
defaults->update("PLUGIN_ICONS", plugin_icons);
defaults->update("SNAPSHOT_PATH", snapshot_path);
int trap_sigintr;
// media thumbnail size
int awindow_picon_h;
+ int vicon_size, vicon_color_mode;
// Title of theme
char theme[BCTEXTLEN];
// plugin icon set
#define FFMPEG_EARLY_TIP _("Currently: Try FFMpeg first\n Click to: Try FFMpeg last")
#define FFMPEG_LATE_TIP _("Currently: Try FFMpeg last\n Click to: Try FFMpeg first")
+#define VICON_COLOR_MODE_LOW 0
+#define VICON_COLOR_MODE_MED 1
+#define VICON_COLOR_MODE_HIGH 2
+
class Preferences;
class PlaybackConfig;
class AudioOutConfig;
mwindow->stop_brender();
if( window ) window->lock_window("PreferencesThread::apply_settings 5");
- if( strcmp(preferences->theme, mwindow->preferences->theme) != 0 )
- mwindow->restart_status = -1; // reload, need new bcresources
- if( strcmp(preferences->plugin_icons, mwindow->preferences->plugin_icons) != 0 )
- mwindow->restart_status = -1;
- if( preferences->awindow_picon_h != mwindow->preferences->awindow_picon_h )
- mwindow->restart_status = -1;
+ if( strcmp(preferences->theme, mwindow->preferences->theme) ||
+ strcmp(preferences->plugin_icons, mwindow->preferences->plugin_icons) ||
+ preferences->awindow_picon_h != mwindow->preferences->awindow_picon_h ||
+ preferences->vicon_size != mwindow->preferences->vicon_size ||
+ preferences->vicon_color_mode != mwindow->preferences->vicon_color_mode )
+ mwindow->restart_status = -1; // reconstruct/restart program
if( strcmp(preferences->lv2_path, mwindow->preferences->lv2_path) != 0 )
reload_plugins = 1;
if( reload_plugins ) {
#include "condition.h"
VIcon::
-VIcon(int vw, int vh, double rate)
+VIcon(int w, int h, double rate)
{
- this->vw = vw;
- this->vh = vh;
+ this->w = w;
+ this->h = h;
this->frame_rate = rate;
cycle_start = 0;
if( !vfrm ) return;
int sx0 = 0, sx1 = sx0 + vt->vw;
int sy0 = 0, sy1 = sy0 + vt->vh;
- int dx0 = x, dx1 = dx0 + vw;
- int dy0 = y, dy1 = dy0 + vh;
- if( (x=vt->draw_x0-dx0) > 0 ) { sx0 += (x*vt->vw)/vw; dx0 = vt->draw_x0; }
- if( (x=dx1-vt->draw_x1) > 0 ) { sx1 -= (x*vt->vw)/vw; dx1 = vt->draw_x1; }
- if( (y=vt->draw_y0-dy0) > 0 ) { sy0 += (y*vt->vh)/vh; dy0 = vt->draw_y0; }
- if( (y=dy1-vt->draw_y1) > 0 ) { sy1 -= (y*vt->vh)/vh; dy1 = vt->draw_y1; }
+ int dx0 = x, dx1 = dx0 + w;
+ int dy0 = y, dy1 = dy0 + h;
+ if( (x=vt->draw_x0-dx0) > 0 ) { sx0 += (x*vt->vw)/w; dx0 = vt->draw_x0; }
+ if( (x=dx1-vt->draw_x1) > 0 ) { sx1 -= (x*vt->vw)/w; dx1 = vt->draw_x1; }
+ if( (y=vt->draw_y0-dy0) > 0 ) { sy0 += (y*vt->vh)/h; dy0 = vt->draw_y0; }
+ if( (y=dy1-vt->draw_y1) > 0 ) { sy1 -= (y*vt->vh)/h; dy1 = vt->draw_y1; }
int sw = sx1 - sx0, sh = sy1 - sy0;
int dw = dx1 - dx0, dh = dy1 - dy0;
if( dw > 0 && dh > 0 && sw > 0 && sh > 0 )
visible(VIcon *vicon, int x, int y)
{
if( vicon->hidden ) return false;
- if( y+vicon->vh <= draw_y0 ) return false;
+ if( y+vicon->h <= draw_y0 ) return false;
if( y >= draw_y1 ) return false;
- if( x+vicon->vw <= draw_x0 ) return false;
+ if( x+vicon->w <= draw_x0 ) return false;
if( x >= draw_x1 ) return false;
return true;
}
int vx = viewing->get_vx(), rx = 0;
int vy = viewing->get_vy(), ry = 0;
wdw->get_root_coordinates(vx, vy, &rx, &ry);
- rx += (rx >= cx ? -view_w : viewing->vw);
- ry += (ry >= cy ? -view_h : viewing->vh);
+ rx += (rx >= cx ? -view_w : viewing->w);
+ ry += (ry >= cy ? -view_h : viewing->h);
ViewPopup *vwin = new ViewPopup(this, frame, rx, ry, view_w, view_h);
wdw->set_active_subwindow(vwin);
return vwin;
class VIcon
{
public:
- int vw, vh, in_use, hidden;
+ int w, h, in_use, hidden;
ArrayList<VIFrame *> images;
int64_t seq_no;
double cycle_start, age, frame_rate;