olaf neophyte and de.po updates, valgrind tweaks, delete green lady, inkscape dpi=96
[goodguy/history.git] / cinelerra-5.1 / cinelerra / new.C
index 6c37e34814f8744c2601464068ef5d97c47b246d..de417e1d6cdb8a6fe647888ca629a04990cec672 100644 (file)
  *
  */
 
+#include "browsebutton.h"
 #include "clip.h"
 #include "cplayback.h"
 #include "cwindow.h"
 #include "bchash.h"
 #include "edl.h"
 #include "edlsession.h"
+#include "filesystem.h"
 #include "filexml.h"
 #include "interlacemodes.h"
 #include "language.h"
 #include "levelwindow.h"
+#include "mainerror.h"
 #include "mainundo.h"
 #include "mainmenu.h"
 #include "mutex.h"
@@ -41,6 +44,8 @@
 #include "preferences.h"
 #include "theme.h"
 #include "transportque.h"
+#include "track.h"
+#include "tracks.h"
 #include "videowindow.h"
 #include "vplayback.h"
 #include "vwindow.h"
 #include <string.h>
 
 
-#define WIDTH 600
-#define HEIGHT 400
-
+#define WIDTH 640
+// full height
+#define HEIGHT0 585
+// add tracks dialog
+#define HEIGHT1 240
+// offset for folder panel
+#define HEIGHT2 440
 
 New::New(MWindow *mwindow)
- : BC_MenuItem(_("New"), "n", 'n')
 {
        this->mwindow = mwindow;
-       script = 0;
        new_edl = 0;
        thread = 0;
 }
@@ -67,18 +74,12 @@ New::~New()
        delete thread;
 }
 
-void New::create_objects()
-{
-       thread = new NewThread(mwindow, this);
-}
-
 int New::handle_event()
 {
        mwindow->gui->unlock_window();
        mwindow->edl->save_defaults(mwindow->defaults);
        create_new_edl();
-       create_new_project();
-//     thread->start();
+       thread->start();
        mwindow->gui->lock_window("New::handle_event");
 
        return 1;
@@ -86,8 +87,7 @@ int New::handle_event()
 
 void New::create_new_edl()
 {
-       if(!new_edl)
-       {
+       if( !new_edl ) {
                new_edl = new EDL;
                new_edl->create_objects();
                new_edl->load_defaults(mwindow->defaults);
@@ -95,58 +95,87 @@ void New::create_new_edl()
 }
 
 
-int New::create_new_project()
+int New::create_new_project(int load_mode)
 {
-       mwindow->cwindow->playback_engine->que->send_command(STOP,
-               CHANGE_NONE,
-               0,
-               0);
-
-       for(int i = 0; i < mwindow->vwindows.size(); i++)
-       {
-               mwindow->vwindows.get(i)->playback_engine->que->send_command(STOP,
-                       CHANGE_NONE,
-                       0,
-                       0);
-               mwindow->vwindows.get(i)->playback_engine->interrupt_playback(0);
-       }
-
-       mwindow->cwindow->playback_engine->interrupt_playback(0);
-
+       mwindow->stop_playback(0);
        mwindow->gui->lock_window();
        mwindow->reset_caches();
 
-
-
        memcpy(new_edl->session->achannel_positions,
-               &mwindow->preferences->channel_positions[
-                       MAXCHANNELS * (new_edl->session->audio_channels - 1)],
-               sizeof(int) * MAXCHANNELS);
+               &mwindow->preferences->channel_positions[new_edl->session->audio_channels - 1],
+               sizeof(new_edl->session->achannel_positions));
        new_edl->session->boundaries();
        new_edl->create_default_tracks();
-
+       if( load_mode == LOADMODE_NEW_TRACKS ) {
+               Tracks *tracks =  mwindow->edl->tracks;
+               int vindex = tracks->total_video_tracks();
+               int aindex = tracks->total_audio_tracks();
+               for( Track *track=new_edl->tracks->first; track; track=track->next ) {
+                       switch( track->data_type ) {
+                       case TRACK_AUDIO:
+                               sprintf(track->title, _("Audio %d"), ++aindex);
+                               break;
+                       case TRACK_VIDEO:
+                               sprintf(track->title, _("Video %d"), ++vindex);
+                               break;
+                       }
+               }
+       }
        mwindow->undo->update_undo_before();
-       mwindow->set_filename("");
-
-       mwindow->hide_plugins();
-       mwindow->edl->Garbage::remove_user();
-       mwindow->edl = new_edl;
+       mwindow->set_filename(new_edl->path);
+       ArrayList<EDL *>new_edls;
+       new_edls.append(new_edl);
+       mwindow->paste_edls(&new_edls, load_mode, 0,0,0,0,0,0);
+       new_edl->remove_user();
        new_edl = 0;
-       mwindow->save_defaults();
 
 // Load file sequence
-       mwindow->update_project(LOADMODE_REPLACE);
+       mwindow->update_project(load_mode);
        mwindow->session->changes_made = 0;
-       mwindow->undo->update_undo_after(_("New"), LOAD_ALL);
+       mwindow->undo->update_undo_after(load_mode == LOADMODE_REPLACE ?
+               _("New Project") : _("Append to Project"), LOAD_ALL);
        mwindow->gui->unlock_window();
        return 0;
 }
 
-NewThread::NewThread(MWindow *mwindow, New *new_project)
+NewProject::NewProject(MWindow *mwindow)
+ : BC_MenuItem(_("New Project..."), "n", 'n'), New(mwindow)
+{
+}
+NewProject::~NewProject()
+{
+}
+
+void NewProject::create_objects()
+{
+       thread = new NewThread(mwindow, this,
+               _(PROGRAM_NAME ": New Project"), LOADMODE_REPLACE);
+}
+
+AppendTracks::AppendTracks(MWindow *mwindow)
+ : BC_MenuItem(_("Append to Project..."), "Shift-N", 'N'), New(mwindow)
+{
+       set_shift(1);
+}
+AppendTracks::~AppendTracks()
+{
+}
+
+void AppendTracks::create_objects()
+{
+       thread = new NewThread(mwindow, this,
+               _(PROGRAM_NAME ": Append to Project"), LOADMODE_NEW_TRACKS);
+}
+
+
+NewThread::NewThread(MWindow *mwindow, New *new_project,
+               const char *title, int load_mode)
  : BC_DialogThread()
 {
        this->mwindow = mwindow;
        this->new_project = new_project;
+       this->title = title;
+       this->load_mode = load_mode;
        nwindow = 0;
 }
 
@@ -155,8 +184,6 @@ NewThread::~NewThread()
        close_window();
 }
 
-
-
 BC_Window* NewThread::new_gui()
 {
        mwindow->edl->save_defaults(mwindow->defaults);
@@ -164,8 +191,8 @@ BC_Window* NewThread::new_gui()
        load_defaults();
 
        mwindow->gui->lock_window("NewThread::new_gui");
-       int x = mwindow->gui->get_abs_cursor_x(0) - WIDTH / 2;
-       int y = mwindow->gui->get_abs_cursor_y(0) - HEIGHT / 2;
+       int x = mwindow->gui->get_pop_cursor_x(0);
+       int y = mwindow->gui->get_pop_cursor_y(0);
 
        nwindow = new NewWindow(mwindow, this, x, y);
        nwindow->create_objects();
@@ -173,28 +200,61 @@ BC_Window* NewThread::new_gui()
        return nwindow;
 }
 
-
+void NewThread::handle_done_event(int result)
+{
+       if( !result && nwindow->folder && nwindow->name ) {
+               const char *project_folder = nwindow->folder->get_text();
+               const char *project_name = nwindow->name->get_text();
+               if( project_folder[0] && project_name[0] ) {
+                       nwindow->recent_folder->add_item("PROJECT", project_folder);
+                       char project_path[BCTEXTLEN], *ep = project_path + sizeof(project_path);
+                       FileSystem fs;  fs.join_names(project_path, project_folder, project_name);
+                       char *bp = strrchr(project_path, '/');
+                       if( !bp ) bp = project_path;
+                       bp = strrchr(bp, '.');
+                       if( !bp ) bp = project_path + strlen(project_path);
+                       if( strcasecmp(bp,".xml") ) snprintf(bp, ep-bp, ".xml");
+                       fs.complete_path(project_path);
+                       EDL *new_edl = new_project->new_edl;
+                       bp = FileSystem::basepath(project_path);
+                       strcpy(new_edl->path, bp);  delete [] bp;
+               }
+       }
+}
 
 void NewThread::handle_close_event(int result)
 {
+       if( !new_project->new_edl ) return;
+
+       FileSystem fs;
+       char *path = new_project->new_edl->path;
+       char *bp = path;
+       while( !result ) {
+               while( *bp == '/' ) ++bp;
+               if( !(bp = strchr(bp, '/')) ) break;
+               char dir_path[BCTEXTLEN];
+               int len = bp - path;
+               strncpy(dir_path, path, len);
+               dir_path[len] = 0;
+               if( fs.is_dir(dir_path) ) continue;
+               if( fs.create_dir(dir_path) ) {
+                       eprintf(_("Cannot create and access project path:\n%s"),
+                               dir_path);
+                       result = 1;
+               }
+       }
 
-       new_project->new_edl->save_defaults(mwindow->defaults);
-       mwindow->defaults->save();
-
-       if(result)
-       {
-// Aborted
-               if( !new_project->new_edl->Garbage::remove_user() )
-                       new_project->new_edl = 0;
+       if( !result ) {
+               new_project->new_edl->save_defaults(mwindow->defaults);
+               mwindow->defaults->save();
+               new_project->create_new_project(load_mode);
        }
-       else
-       {
-               new_project->create_new_project();
+       else { // Aborted
+               new_project->new_edl->Garbage::remove_user();
+               new_project->new_edl = 0;
        }
 }
 
-
-
 int NewThread::load_defaults()
 {
        auto_aspect = mwindow->defaults->get("AUTOASPECT", 0);
@@ -209,50 +269,50 @@ int NewThread::save_defaults()
 
 int NewThread::update_aspect()
 {
-       if(auto_aspect)
-       {
+       if( auto_aspect ) {
                char string[BCTEXTLEN];
                mwindow->create_aspect_ratio(new_project->new_edl->session->aspect_w,
                        new_project->new_edl->session->aspect_h,
                        new_project->new_edl->session->output_w,
                        new_project->new_edl->session->output_h);
                sprintf(string, "%.02f", new_project->new_edl->session->aspect_w);
-               nwindow->aspect_w_text->update(string);
+               if( nwindow->aspect_w_text ) nwindow->aspect_w_text->update(string);
                sprintf(string, "%.02f", new_project->new_edl->session->aspect_h);
-               nwindow->aspect_h_text->update(string);
+               if( nwindow->aspect_h_text )nwindow->aspect_h_text->update(string);
        }
        return 0;
 }
 
 
-
-
-#if 0
-N_("Cinelerra: New Project");
-#endif
-
 NewWindow::NewWindow(MWindow *mwindow, NewThread *new_thread, int x, int y)
- : BC_Window(_(_(PROGRAM_NAME ": New Project")),
-               x,
-               y,
-               WIDTH,
-               HEIGHT,
-               -1,
-               -1,
-               0,
-               0,
-               1)
+ : BC_Window(new_thread->title, x, y,
+               WIDTH, new_thread->load_mode == LOADMODE_REPLACE ? HEIGHT0 : HEIGHT1,
+               -1, -1, 0, 0, 1)
 {
        this->mwindow = mwindow;
        this->new_thread = new_thread;
        this->new_edl = new_thread->new_project->new_edl;
        format_presets = 0;
+       atracks = 0;
+       achannels = 0;
+       sample_rate = 0;
+       vtracks = 0;
+       frame_rate = 0;
+       output_w_text = 0;
+       output_h_text = 0;
+       aspect_w_text = 0;
+       aspect_h_text = 0;
+       interlace_pulldown = 0;
+       color_model = 0;
+       folder = 0;
+       name = 0;
+       recent_folder = 0;
 }
 
 NewWindow::~NewWindow()
 {
        lock_window("NewWindow::~NewWindow");
-       if(format_presets) delete format_presets;
+       delete format_presets;
        unlock_window();
 }
 
@@ -260,11 +320,14 @@ void NewWindow::create_objects()
 {
        int x = 10, y = 10, x1, y1;
        BC_TextBox *textbox;
+       BC_Title *title;
 
        lock_window("NewWindow::create_objects");
        mwindow->theme->draw_new_bg(this);
 
-       add_subwindow(new BC_Title(x, y, _("Parameters for the new project:")));
+       add_subwindow( new BC_Title(x, y, new_thread->load_mode == LOADMODE_REPLACE ?
+                       _("Parameters for the new project:") :
+                       _("Parameters for additional tracks:") ) );
        y += 20;
 
        format_presets = new NewPresets(mwindow,
@@ -275,8 +338,6 @@ void NewWindow::create_objects()
        x = format_presets->x;
        y = format_presets->y;
 
-
-
        y += 40;
        y1 = y;
        add_subwindow(new BC_Title(x, y, _("Audio"), LARGEFONT));
@@ -290,20 +351,22 @@ void NewWindow::create_objects()
        add_subwindow(new NewATracksTumbler(this, x1, y));
        y += atracks->get_h() + 5;
 
-       x1 = x;
-       add_subwindow(new BC_Title(x1, y, _("Channels:")));
-       x1 += 100;
-       add_subwindow(achannels = new NewAChannels(this, "", x1, y));
-       x1 += achannels->get_w();
-       add_subwindow(new NewAChannelsTumbler(this, x1, y));
-       y += achannels->get_h() + 5;
-
-       x1 = x;
-       add_subwindow(new BC_Title(x1, y, _("Samplerate:")));
-       x1 += 100;
-       add_subwindow(sample_rate = new NewSampleRate(this, "", x1, y));
-       x1 += sample_rate->get_w();
-       add_subwindow(new SampleRatePulldown(mwindow, sample_rate, x1, y));
+       if( new_thread->load_mode == LOADMODE_REPLACE ) {
+               x1 = x;
+               add_subwindow(new BC_Title(x1, y, _("Channels:")));
+               x1 += 100;
+               add_subwindow(achannels = new NewAChannels(this, "", x1, y));
+               x1 += achannels->get_w();
+               add_subwindow(new NewAChannelsTumbler(this, x1, y));
+               y += achannels->get_h() + 5;
+
+               x1 = x;
+               add_subwindow(new BC_Title(x1, y, _("Samplerate:")));
+               x1 += 100;
+               add_subwindow(sample_rate = new NewSampleRate(this, "", x1, y));
+               x1 += sample_rate->get_w();
+               add_subwindow(new SampleRatePulldown(mwindow, sample_rate, x1, y));
+       }
 
        x += 250;
        y = y1;
@@ -311,27 +374,28 @@ void NewWindow::create_objects()
        y += 30;
        x1 = x;
        add_subwindow(new BC_Title(x1, y, _("Tracks:")));
-       x1 += 100;
+       x1 += 115;
        add_subwindow(vtracks = new NewVTracks(this, "", x1, y));
        x1 += vtracks->get_w();
        add_subwindow(new NewVTracksTumbler(this, x1, y));
        y += vtracks->get_h() + 5;
 
-//     x1 = x;
-//     add_subwindow(new BC_Title(x1, y, _("Channels:")));
-//     x1 += 100;
-//     add_subwindow(vchannels = new NewVChannels(this, "", x1, y));
-//     x1 += vchannels->get_w();
-//     add_subwindow(new NewVChannelsTumbler(this, x1, y));
-//     y += vchannels->get_h() + 5;
-       x1 = x;
-       add_subwindow(new BC_Title(x1, y, _("Framerate:")));
-       x1 += 100;
-       add_subwindow(frame_rate = new NewFrameRate(this, "", x1, y));
-       x1 += frame_rate->get_w();
-       add_subwindow(new FrameRatePulldown(mwindow, frame_rate, x1, y));
-       y += frame_rate->get_h() + 5;
-
+       if( new_thread->load_mode == LOADMODE_REPLACE ) {
+//             x1 = x;
+//             add_subwindow(new BC_Title(x1, y, _("Channels:")));
+//             x1 += 100;
+//             add_subwindow(vchannels = new NewVChannels(this, "", x1, y));
+//             x1 += vchannels->get_w();
+//             add_subwindow(new NewVChannelsTumbler(this, x1, y));
+//             y += vchannels->get_h() + 5;
+               x1 = x;
+               add_subwindow(new BC_Title(x1, y, _("Framerate:")));
+               x1 += 115;
+               add_subwindow(frame_rate = new NewFrameRate(this, "", x1, y));
+               x1 += frame_rate->get_w();
+               add_subwindow(new FrameRatePulldown(mwindow, frame_rate, x1, y));
+               y += frame_rate->get_h() + 5;
+       }
 //     x1 = x;
 //     add_subwindow(new BC_Title(x1, y, _("Canvas size:")));
 //     x1 += 100;
@@ -351,8 +415,9 @@ void NewWindow::create_objects()
 //     y += canvas_h_text->get_h() + 5;
 
        x1 = x;
-       add_subwindow(new BC_Title(x1, y, _("Canvas size:")));
-       x1 += 100;
+       add_subwindow(new BC_Title(x1, y, new_thread->load_mode == LOADMODE_REPLACE ?
+                       _("Canvas size:") : _("Track size:")));
+       x1 += 115;
        add_subwindow(output_w_text = new NewOutputW(this, x1, y));
        x1 += output_w_text->get_w() + 2;
        add_subwindow(new BC_Title(x1, y, "x"));
@@ -365,48 +430,59 @@ void NewWindow::create_objects()
                output_h_text,
                x1,
                y));
-       x1 += pulldown->get_w() + 5;
+       x1 += pulldown->get_w() + 10;
        add_subwindow(new NewSwapExtents(mwindow, this, x1, y));
        y += output_h_text->get_h() + 5;
 
-       x1 = x;
-       add_subwindow(new BC_Title(x1, y, _("Aspect ratio:")));
-       x1 += 100;
-       add_subwindow(aspect_w_text = new NewAspectW(this, "", x1, y));
-       x1 += aspect_w_text->get_w() + 2;
-       add_subwindow(new BC_Title(x1, y, ":"));
-       x1 += 10;
-       add_subwindow(aspect_h_text = new NewAspectH(this, "", x1, y));
-       x1 += aspect_h_text->get_w();
-       add_subwindow(new AspectPulldown(mwindow,
-               aspect_w_text,
-               aspect_h_text,
-               x1,
-               y));
-
-       x1 = aspect_w_text->get_x();
-       y += aspect_w_text->get_h() + 5;
-       add_subwindow(new NewAspectAuto(this, x1, y));
-       y += 40;
-       add_subwindow(new BC_Title(x, y, _("Color model:")));
-       add_subwindow(textbox = new BC_TextBox(x + 100, y, 200, 1, ""));
-       add_subwindow(color_model = new ColormodelPulldown(mwindow,
-               textbox,
-               &new_edl->session->color_model,
-               x + 100 + textbox->get_w(),
-               y));
-       y += textbox->get_h() + 5;
-
-       // --------------------
-       add_subwindow(new BC_Title(x, y, _("Interlace mode:")));
-       add_subwindow(textbox = new BC_TextBox(x + 100, y, 140, 1, ""));
-       add_subwindow(interlace_pulldown = new InterlacemodePulldown(mwindow,
-               textbox,
-               &new_edl->session->interlace_mode,
-               (ArrayList<BC_ListBoxItem*>*)&mwindow->interlace_project_modes,
-               x + 100 + textbox->get_w(),
-               y));
-       y += textbox->get_h() + 5;
+       if( new_thread->load_mode == LOADMODE_REPLACE ) {
+               x1 = x;
+               add_subwindow(new BC_Title(x1, y, _("Aspect ratio:")));
+               x1 += 115;
+               add_subwindow(aspect_w_text = new NewAspectW(this, "", x1, y));
+               x1 += aspect_w_text->get_w() + 2;
+               add_subwindow(new BC_Title(x1, y, ":"));
+               x1 += 10;
+               add_subwindow(aspect_h_text = new NewAspectH(this, "", x1, y));
+               x1 += aspect_h_text->get_w();
+               add_subwindow(new AspectPulldown(mwindow,
+                       aspect_w_text, aspect_h_text, x1, y));
+
+               x1 = aspect_w_text->get_x();
+               y += aspect_w_text->get_h() + 5;
+               add_subwindow(new NewAspectAuto(this, x1, y));
+               y += 40;
+               add_subwindow(title = new BC_Title(x, y, _("Color model:")));
+               x1 = x + title->get_w();
+               y1 = y;  y += title->get_h() + 10;
+               add_subwindow(title = new BC_Title(x, y, _("Interlace mode:")));
+               int x2 = x + title->get_w();
+               int y2 = y;  y += title->get_h() + 10;
+               if( x1 < x2 ) x1 = x2;
+               x1 += 20;
+               add_subwindow(textbox = new BC_TextBox(x1, y1, 150, 1, ""));
+               add_subwindow(color_model = new ColormodelPulldown(mwindow,
+                       textbox, &new_edl->session->color_model, x1+textbox->get_w(), y1));
+               add_subwindow(textbox = new BC_TextBox(x1, y2, 150, 1, ""));
+               add_subwindow(interlace_pulldown = new InterlacemodePulldown(mwindow,
+                       textbox, &new_edl->session->interlace_mode,
+                       (ArrayList<BC_ListBoxItem*>*)&mwindow->interlace_project_modes,
+                       x1+textbox->get_w(), y2));
+
+               x = 20;  y = HEIGHT2;
+               add_subwindow(title = new BC_Title(x, y, _("Create project folder in:")));
+               x1 = x;  y += title->get_h() + 5;
+               add_subwindow(folder = new BC_TextBox(x1, y, get_w()-x1-64, 1, ""));
+               x1 += folder->get_w() + 10;
+               add_subwindow(recent_folder = new BC_RecentList("FOLDER", mwindow->defaults, folder));
+               recent_folder->load_items("PROJECT");
+               x1 = recent_folder->get_x() + recent_folder->get_w();
+               add_subwindow(new BrowseButton(mwindow->theme, this, folder, x1, y, "",
+                        _("Project Directory"), _("Project Directory Path:"), 1));
+               y += folder->get_h() + 10;  x1 = x;
+               add_subwindow(title = new BC_Title(x1, y, _("Project Name:")));
+               x1 += title->get_w() + 10;
+               add_subwindow(name = new BC_TextBox(x1, y, get_w()-x1-64, 1, ""));
+       }
 
        add_subwindow(new BC_OKButton(this,
                mwindow->theme->get_image_set("new_ok_images")));
@@ -420,26 +496,21 @@ void NewWindow::create_objects()
 
 int NewWindow::update()
 {
-       atracks->update((int64_t)new_edl->session->audio_tracks);
-       achannels->update((int64_t)new_edl->session->audio_channels);
-       sample_rate->update((int64_t)new_edl->session->sample_rate);
-       vtracks->update((int64_t)new_edl->session->video_tracks);
-       frame_rate->update((float)new_edl->session->frame_rate);
-       output_w_text->update((int64_t)new_edl->session->output_w);
-       output_h_text->update((int64_t)new_edl->session->output_h);
-       aspect_w_text->update((float)new_edl->session->aspect_w);
-       aspect_h_text->update((float)new_edl->session->aspect_h);
-       interlace_pulldown->update(new_edl->session->interlace_mode);
-       color_model->update_value(new_edl->session->color_model);
+       if( atracks ) atracks->update((int64_t)new_edl->session->audio_tracks);
+       if( achannels ) achannels->update((int64_t)new_edl->session->audio_channels);
+       if( sample_rate ) sample_rate->update((int64_t)new_edl->session->sample_rate);
+       if( vtracks ) vtracks->update((int64_t)new_edl->session->video_tracks);
+       if( frame_rate ) frame_rate->update((float)new_edl->session->frame_rate);
+       if( output_w_text ) output_w_text->update((int64_t)new_edl->session->output_w);
+       if( output_h_text ) output_h_text->update((int64_t)new_edl->session->output_h);
+       if( aspect_w_text ) aspect_w_text->update((float)new_edl->session->aspect_w);
+       if( aspect_h_text ) aspect_h_text->update((float)new_edl->session->aspect_h);
+       if( interlace_pulldown ) interlace_pulldown->update(new_edl->session->interlace_mode);
+       if( color_model ) color_model->update_value(new_edl->session->color_model);
        return 0;
 }
 
 
-
-
-
-
-
 NewPresets::NewPresets(MWindow *mwindow, NewWindow *gui, int x, int y)
  : FormatPresets(mwindow, gui, 0, x, y)
 {
@@ -461,7 +532,6 @@ EDL* NewPresets::get_edl()
 }
 
 
-
 NewATracks::NewATracks(NewWindow *nwindow, const char *text, int x, int y)
  : BC_TextBox(x, y, 90, 1, text)
 {
@@ -494,6 +564,7 @@ int NewATracksTumbler::handle_down_event()
        return 1;
 }
 
+
 NewAChannels::NewAChannels(NewWindow *nwindow, const char *text, int x, int y)
  : BC_TextBox(x, y, 90, 1, text)
 {
@@ -506,6 +577,7 @@ int NewAChannels::handle_event()
        return 1;
 }
 
+
 NewAChannelsTumbler::NewAChannelsTumbler(NewWindow *nwindow, int x, int y)
  : BC_Tumbler(x, y)
 {
@@ -539,18 +611,10 @@ int NewSampleRate::handle_event()
        return 1;
 }
 
+
 SampleRatePulldown::SampleRatePulldown(MWindow *mwindow, BC_TextBox *output, int x, int y)
- : BC_ListBox(x,
-       y,
-       100,
-       200,
-       LISTBOX_TEXT,
-       &mwindow->theme->sample_rates,
-       0,
-       0,
-       1,
-       0,
-       1)
+ : BC_ListBox(x, y, 100, 200, LISTBOX_TEXT,
+       &mwindow->theme->sample_rates, 0, 0, 1, 0, 1)
 {
        this->mwindow = mwindow;
        this->output = output;
@@ -564,19 +628,6 @@ int SampleRatePulldown::handle_event()
 }
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
 NewVTracks::NewVTracks(NewWindow *nwindow, const char *text, int x, int y)
  : BC_TextBox(x, y, 90, 1, text)
 {
@@ -589,6 +640,7 @@ int NewVTracks::handle_event()
        return 1;
 }
 
+
 NewVTracksTumbler::NewVTracksTumbler(NewWindow *nwindow, int x, int y)
  : BC_Tumbler(x, y)
 {
@@ -609,6 +661,7 @@ int NewVTracksTumbler::handle_down_event()
        return 1;
 }
 
+
 NewVChannels::NewVChannels(NewWindow *nwindow, const char *text, int x, int y)
  : BC_TextBox(x, y, 90, 1, text)
 {
@@ -621,6 +674,7 @@ int NewVChannels::handle_event()
        return 1;
 }
 
+
 NewVChannelsTumbler::NewVChannelsTumbler(NewWindow *nwindow, int x, int y)
  : BC_Tumbler(x, y)
 {
@@ -641,6 +695,7 @@ int NewVChannelsTumbler::handle_down_event()
        return 1;
 }
 
+
 NewFrameRate::NewFrameRate(NewWindow *nwindow, const char *text, int x, int y)
  : BC_TextBox(x, y, 90, 1, text)
 {
@@ -653,21 +708,11 @@ int NewFrameRate::handle_event()
        return 1;
 }
 
+
 FrameRatePulldown::FrameRatePulldown(MWindow *mwindow,
-       BC_TextBox *output,
-       int x,
-       int y)
- : BC_ListBox(x,
-       y,
-       100,
-       200,
-       LISTBOX_TEXT,
-       &mwindow->theme->frame_rates,
-       0,
-       0,
-       1,
-       0,
-       1)
+       BC_TextBox *output, int x, int y)
+ : BC_ListBox(x, y, 150, 250, LISTBOX_TEXT,
+       &mwindow->theme->frame_rates, 0, 0, 1, 0, 1)
 {
        this->mwindow = mwindow;
        this->output = output;
@@ -681,26 +726,15 @@ int FrameRatePulldown::handle_event()
 }
 
 FrameSizePulldown::FrameSizePulldown(Theme *theme,
-               BC_TextBox *output_w,
-               BC_TextBox *output_h,
-               int x,
-               int y)
- : BC_ListBox(x,
-       y,
-       100,
-       250,
-       LISTBOX_TEXT,
-       &theme->frame_sizes,
-       0,
-       0,
-       1,
-       0,
-       1)
+               BC_TextBox *output_w, BC_TextBox *output_h, int x, int y)
+ : BC_ListBox(x, y, 180, 250, LISTBOX_TEXT,
+       &theme->frame_sizes, 0, 0, 1, 0, 1)
 {
        this->theme = theme;
        this->output_w = output_w;
        this->output_h = output_h;
 }
+
 int FrameSizePulldown::handle_event()
 {
        char *text = get_selection(0, 0)->get_text();
@@ -710,8 +744,7 @@ int FrameSizePulldown::handle_event()
 
        strcpy(string, text);
        ptr = strrchr(string, 'x');
-       if(ptr)
-       {
+       if( ptr ) {
                ptr++;
                h = atol(ptr);
 
@@ -725,6 +758,7 @@ int FrameSizePulldown::handle_event()
        return 1;
 }
 
+
 NewOutputW::NewOutputW(NewWindow *nwindow, int x, int y)
  : BC_TextBox(x, y, 70, 1, nwindow->new_edl->session->output_w)
 {
@@ -737,6 +771,7 @@ int NewOutputW::handle_event()
        return 1;
 }
 
+
 NewOutputH::NewOutputH(NewWindow *nwindow, int x, int y)
  : BC_TextBox(x, y, 70, 1, nwindow->new_edl->session->output_h)
 {
@@ -749,6 +784,7 @@ int NewOutputH::handle_event()
        return 1;
 }
 
+
 NewAspectW::NewAspectW(NewWindow *nwindow, const char *text, int x, int y)
  : BC_TextBox(x, y, 70, 1, text)
 {
@@ -761,6 +797,7 @@ int NewAspectW::handle_event()
        return 1;
 }
 
+
 NewAspectH::NewAspectH(NewWindow *nwindow, const char *text, int x, int y)
  : BC_TextBox(x, y, 70, 1, text)
 {
@@ -773,27 +810,17 @@ int NewAspectH::handle_event()
        return 1;
 }
 
+
 AspectPulldown::AspectPulldown(MWindow *mwindow,
-               BC_TextBox *output_w,
-               BC_TextBox *output_h,
-               int x,
-               int y)
- : BC_ListBox(x,
-       y,
-       100,
-       200,
-       LISTBOX_TEXT,
-       &mwindow->theme->aspect_ratios,
-       0,
-       0,
-       1,
-       0,
-       1)
+               BC_TextBox *output_w, BC_TextBox *output_h, int x, int y)
+ : BC_ListBox(x, y, 100, 200, LISTBOX_TEXT,
+       &mwindow->theme->aspect_ratios, 0, 0, 1, 0, 1)
 {
        this->mwindow = mwindow;
        this->output_w = output_w;
        this->output_h = output_h;
 }
+
 int AspectPulldown::handle_event()
 {
        char *text = get_selection(0, 0)->get_text();
@@ -803,8 +830,7 @@ int AspectPulldown::handle_event()
 
        strcpy(string, text);
        ptr = strrchr(string, ':');
-       if(ptr)
-       {
+       if( ptr ) {
                ptr++;
                h = atof(ptr);
 
@@ -818,6 +844,7 @@ int AspectPulldown::handle_event()
        return 1;
 }
 
+
 ColormodelItem::ColormodelItem(const char *text, int value)
  : BC_ListBoxItem(text)
 {
@@ -825,21 +852,9 @@ ColormodelItem::ColormodelItem(const char *text, int value)
 }
 
 ColormodelPulldown::ColormodelPulldown(MWindow *mwindow,
-               BC_TextBox *output_text,
-               int *output_value,
-               int x,
-               int y)
- : BC_ListBox(x,
-       y,
-       200,
-       150,
-       LISTBOX_TEXT,
-       (ArrayList<BC_ListBoxItem*>*)&mwindow->colormodels,
-       0,
-       0,
-       1,
-       0,
-       1)
+               BC_TextBox *output_text, int *output_value, int x, int y)
+ : BC_ListBox(x, y, 200, 150, LISTBOX_TEXT,
+       (ArrayList<BC_ListBoxItem*>*)&mwindow->colormodels, 0, 0, 1, 0, 1)
 {
        this->mwindow = mwindow;
        this->output_text = output_text;
@@ -856,8 +871,8 @@ int ColormodelPulldown::handle_event()
 
 const char* ColormodelPulldown::colormodel_to_text()
 {
-       for(int i = 0; i < mwindow->colormodels.total; i++)
-               if(mwindow->colormodels.values[i]->value == *output_value)
+       for( int i=0; i<mwindow->colormodels.total; ++i )
+               if( mwindow->colormodels.values[i]->value == *output_value )
                        return mwindow->colormodels.values[i]->get_text();
        return _("Unknown");
 }
@@ -926,12 +941,6 @@ int NewAspectAuto::handle_event()
 }
 
 
-
-
-
-
-
-
 NewSwapExtents::NewSwapExtents(MWindow *mwindow, NewWindow *gui, int x, int y)
  : BC_Button(x, y, mwindow->theme->get_image_set("swap_extents"))
 {
@@ -952,6 +961,3 @@ int NewSwapExtents::handle_event()
        return 1;
 }
 
-
-
-