00001 #include "asset.h"
00002 #include "assetedit.h"
00003 #include "awindow.h"
00004 #include "awindowgui.h"
00005 #include "bcprogressbox.h"
00006 #include "bitspopup.h"
00007 #include "cache.h"
00008 #include "clip.h"
00009 #include "cplayback.h"
00010 #include "cwindow.h"
00011 #include "file.h"
00012 #include "filempeg.h"
00013 #include "filesystem.h"
00014 #include "indexfile.h"
00015 #include "language.h"
00016 #include "mainindexes.h"
00017 #include "mwindow.h"
00018 #include "mwindowgui.h"
00019 #include "theme.h"
00020 #include "new.h"
00021 #include "preferences.h"
00022 #include "transportque.h"
00023 #include "interlacemodes.h"
00024 #include "edl.h"
00025 #include "edlsession.h"
00026
00027 #include <string.h>
00028
00029
00030
00031 AssetEdit::AssetEdit(MWindow *mwindow)
00032 : Thread()
00033 {
00034 this->mwindow = mwindow;
00035 asset = 0;
00036 window = 0;
00037 set_synchronous(0);
00038 }
00039
00040
00041 AssetEdit::~AssetEdit()
00042 {
00043 }
00044
00045
00046 void AssetEdit::edit_asset(Asset *asset)
00047 {
00048 if(asset)
00049 {
00050
00051 this->asset = asset;
00052 Thread::start();
00053 }
00054 }
00055
00056
00057 int AssetEdit::set_asset(Asset *asset)
00058 {
00059 this->asset = asset;
00060 return 0;
00061 }
00062
00063 void AssetEdit::run()
00064 {
00065 if(asset)
00066 {
00067 new_asset = new Asset(asset->path);
00068 *new_asset = *asset;
00069 int result = 0;
00070
00071 window = new AssetEditWindow(mwindow, this);
00072 window->create_objects();
00073 window->raise_window();
00074 result = window->run_window();
00075
00076 if(!result)
00077 {
00078 if(!asset->equivalent(*new_asset, 1, 1))
00079 {
00080 mwindow->gui->lock_window();
00081 mwindow->remove_asset_from_caches(asset);
00082
00083
00084 asset->copy_from(new_asset, 0);
00085
00086 mwindow->gui->update(0,
00087 2,
00088 0,
00089 0,
00090 0,
00091 0,
00092 0);
00093
00094
00095 if(asset->audio_data)
00096 {
00097 char source_filename[BCTEXTLEN];
00098 char index_filename[BCTEXTLEN];
00099 IndexFile::get_index_filename(source_filename,
00100 mwindow->preferences->index_directory,
00101 index_filename,
00102 asset->path);
00103 remove(index_filename);
00104 asset->index_status = INDEX_NOTTESTED;
00105 mwindow->mainindexes->add_next_asset(0, asset);
00106 mwindow->mainindexes->start_build();
00107 }
00108 mwindow->gui->unlock_window();
00109
00110
00111 mwindow->awindow->gui->async_update_assets();
00112
00113 mwindow->restart_brender();
00114 mwindow->sync_parameters(CHANGE_ALL);
00115 }
00116 }
00117
00118 Garbage::delete_object(new_asset);
00119 delete window;
00120 window = 0;
00121 }
00122 }
00123
00124
00125
00126
00127
00128
00129
00130
00131 AssetEditWindow::AssetEditWindow(MWindow *mwindow, AssetEdit *asset_edit)
00132 : BC_Window(PROGRAM_NAME ": Asset Info",
00133 mwindow->gui->get_abs_cursor_x(1) - 400 / 2,
00134 mwindow->gui->get_abs_cursor_y(1) - 550 / 2,
00135 400,
00136 660,
00137 400,
00138 560,
00139 0,
00140 0,
00141 1)
00142 {
00143 this->mwindow = mwindow;
00144 this->asset_edit = asset_edit;
00145 this->asset = asset_edit->new_asset;
00146 bitspopup = 0;
00147 if(asset->format == FILE_PCM)
00148 allow_edits = 1;
00149 else
00150 allow_edits = 0;
00151 }
00152
00153
00154
00155
00156
00157 AssetEditWindow::~AssetEditWindow()
00158 {
00159 if(bitspopup) delete bitspopup;
00160 }
00161
00162
00163
00164
00165 int AssetEditWindow::create_objects()
00166 {
00167 int y = 10, x = 10, x1 = 10, x2 = 160;
00168 char string[BCTEXTLEN];
00169 int vmargin;
00170 int hmargin1 = 180, hmargin2 = 290;
00171 FileSystem fs;
00172 BC_Title *title;
00173 BC_TextBox *textboxw;
00174 BC_CheckBox *chkboxw;
00175 BC_ListBox *listboxw;
00176 Interlaceautofix *ilacefixoption_chkboxw;
00177
00178 if(allow_edits)
00179 vmargin = 30;
00180 else
00181 vmargin = 20;
00182
00183 add_subwindow(path_text = new AssetEditPathText(this, y));
00184 add_subwindow(path_button = new AssetEditPath(mwindow,
00185 this,
00186 path_text,
00187 y,
00188 asset->path,
00189 PROGRAM_NAME ": Asset path", _("Select a file for this asset:")));
00190 y += 30;
00191
00192 add_subwindow(new BC_Title(x, y, _("File format:")));
00193 x = x2;
00194 add_subwindow(new BC_Title(x, y, File::formattostr(mwindow->plugindb, asset->format), MEDIUMFONT, mwindow->theme->edit_font_color));
00195 x = x1;
00196 y += 20;
00197
00198 int64_t bytes = 1;
00199 int subtitle_tracks = 0;
00200 if(asset->format == FILE_MPEG &&
00201 asset->video_data)
00202 {
00203
00204 FileMPEG::get_info(asset, &bytes, &subtitle_tracks);
00205 }
00206 else
00207 {
00208 bytes = fs.get_size(asset->path);
00209 }
00210 add_subwindow(new BC_Title(x, y, _("Bytes:")));
00211 sprintf(string, "%lld", bytes);
00212 Units::punctuate(string);
00213
00214
00215 add_subwindow(new BC_Title(x2, y, string, MEDIUMFONT, mwindow->theme->edit_font_color));
00216 y += 20;
00217 x = x1;
00218
00219 double length;
00220 if(asset->audio_length > 0)
00221 length = (double)asset->audio_length / asset->sample_rate;
00222 if(asset->video_length > 0)
00223 length = MAX(length, (double)asset->video_length / asset->frame_rate);
00224 int64_t bitrate;
00225 if(!EQUIV(length, 0))
00226 bitrate = (int64_t)(bytes * 8 / length);
00227 else
00228 bitrate = bytes;
00229 add_subwindow(new BC_Title(x, y, _("Bitrate (bits/sec):")));
00230 sprintf(string, "%lld", bitrate);
00231
00232 Units::punctuate(string);
00233 add_subwindow(new BC_Title(x2, y, string, MEDIUMFONT, mwindow->theme->edit_font_color));
00234
00235 y += 30;
00236 x = x1;
00237
00238 if(asset->audio_data)
00239 {
00240 add_subwindow(new BC_Bar(x, y, get_w() - x * 2));
00241 y += 5;
00242
00243 add_subwindow(new BC_Title(x, y, _("Audio:"), LARGEFONT, RED));
00244
00245 y += 30;
00246
00247 if(asset->get_compression_text(1, 0))
00248 {
00249 add_subwindow(new BC_Title(x, y, _("Compression:")));
00250 x = x2;
00251 add_subwindow(new BC_Title(x,
00252 y,
00253 asset->get_compression_text(1, 0),
00254 MEDIUMFONT,
00255 mwindow->theme->edit_font_color));
00256 y += vmargin;
00257 x = x1;
00258 }
00259
00260 add_subwindow(new BC_Title(x, y, _("Channels:")));
00261 sprintf(string, "%d", asset->channels);
00262
00263 x = x2;
00264 if(allow_edits)
00265 {
00266 BC_TumbleTextBox *textbox = new AssetEditChannels(this, string, x, y);
00267 textbox->create_objects();
00268 y += vmargin;
00269 }
00270 else
00271 {
00272 add_subwindow(new BC_Title(x, y, string, MEDIUMFONT, mwindow->theme->edit_font_color));
00273 y += 20;
00274 }
00275
00276 x = x1;
00277 add_subwindow(new BC_Title(x, y, _("Sample rate:")));
00278 sprintf(string, "%d", asset->sample_rate);
00279
00280 x = x2;
00281
00282 if(1)
00283 {
00284 BC_TextBox *textbox;
00285 add_subwindow(textbox = new AssetEditRate(this, string, x, y));
00286 x += textbox->get_w();
00287 add_subwindow(new SampleRatePulldown(mwindow, textbox, x, y));
00288 }
00289 else
00290 {
00291 add_subwindow(new BC_Title(x, y, string, MEDIUMFONT, mwindow->theme->edit_font_color));
00292 }
00293
00294 y += 30;
00295 x = x1;
00296
00297 add_subwindow(new BC_Title(x, y, _("Bits:")));
00298 x = x2;
00299 if(allow_edits)
00300 {
00301 bitspopup = new BitsPopup(this,
00302 x,
00303 y,
00304 &asset->bits,
00305 1,
00306 1,
00307 1,
00308 0,
00309 1);
00310 bitspopup->create_objects();
00311 }
00312 else
00313 add_subwindow(new BC_Title(x, y, File::bitstostr(asset->bits), MEDIUMFONT, mwindow->theme->edit_font_color));
00314
00315
00316 x = x1;
00317 y += vmargin;
00318 add_subwindow(new BC_Title(x, y, _("Header length:")));
00319 sprintf(string, "%d", asset->header);
00320
00321 x = x2;
00322 if(allow_edits)
00323 add_subwindow(new AssetEditHeader(this, string, x, y));
00324 else
00325 add_subwindow(new BC_Title(x, y, string, MEDIUMFONT, mwindow->theme->edit_font_color));
00326
00327 y += vmargin;
00328 x = x1;
00329
00330 add_subwindow(new BC_Title(x, y, _("Byte order:")));
00331
00332 if(allow_edits)
00333 {
00334 x = x2;
00335
00336 add_subwindow(lohi = new AssetEditByteOrderLOHI(this,
00337 asset->byte_order,
00338 x,
00339 y));
00340 x += 70;
00341 add_subwindow(hilo = new AssetEditByteOrderHILO(this,
00342 !asset->byte_order,
00343 x,
00344 y));
00345 y += vmargin;
00346 }
00347 else
00348 {
00349 x = x2;
00350 if(asset->byte_order)
00351 add_subwindow(new BC_Title(x, y, _("Lo-Hi"), MEDIUMFONT, mwindow->theme->edit_font_color));
00352 else
00353 add_subwindow(new BC_Title(x, y, _("Hi-Lo"), MEDIUMFONT, mwindow->theme->edit_font_color));
00354 y += vmargin;
00355 }
00356
00357
00358 x = x1;
00359 if(allow_edits)
00360 {
00361
00362 add_subwindow(new AssetEditSigned(this, asset->signed_, x, y));
00363 }
00364 else
00365 {
00366 if(!asset->signed_ && asset->bits == 8)
00367 add_subwindow(new BC_Title(x, y, _("Values are unsigned")));
00368 else
00369 add_subwindow(new BC_Title(x, y, _("Values are signed")));
00370 }
00371
00372 y += 30;
00373 }
00374
00375 x = x1;
00376 if(asset->video_data)
00377 {
00378 add_subwindow(new BC_Bar(x, y, get_w() - x * 2));
00379 y += 5;
00380
00381 add_subwindow(new BC_Title(x, y, _("Video:"), LARGEFONT, RED));
00382
00383
00384 y += 30;
00385 x = x1;
00386 if(asset->get_compression_text(0,1))
00387 {
00388 add_subwindow(new BC_Title(x, y, _("Compression:")));
00389 x = x2;
00390 add_subwindow(new BC_Title(x,
00391 y,
00392 asset->get_compression_text(0,1),
00393 MEDIUMFONT,
00394 mwindow->theme->edit_font_color));
00395 y += vmargin;
00396 x = x1;
00397 }
00398
00399 add_subwindow(new BC_Title(x, y, _("Frame rate:")));
00400 x = x2;
00401 sprintf(string, "%.2f", asset->frame_rate);
00402 BC_TextBox *framerate;
00403 add_subwindow(framerate = new AssetEditFRate(this, string, x, y));
00404 x += 105;
00405 add_subwindow(new FrameRatePulldown(mwindow, framerate, x, y));
00406
00407 y += 30;
00408 x = x1;
00409 add_subwindow(new BC_Title(x, y, _("Width:")));
00410 x = x2;
00411 sprintf(string, "%d", asset->width);
00412 add_subwindow(new BC_Title(x, y, string, MEDIUMFONT, mwindow->theme->edit_font_color));
00413
00414 y += vmargin;
00415 x = x1;
00416 add_subwindow(new BC_Title(x, y, _("Height:")));
00417 x = x2;
00418 sprintf(string, "%d", asset->height);
00419 add_subwindow(title = new BC_Title(x, y, string, MEDIUMFONT, mwindow->theme->edit_font_color));
00420 y += title->get_h() + 5;
00421
00422 if(asset->format == FILE_MPEG)
00423 {
00424 x = x1;
00425 add_subwindow(new BC_Title(x, y, _("Subtitle tracks:")));
00426 x = x2;
00427 sprintf(string, "%d", subtitle_tracks);
00428 add_subwindow(title = new BC_Title(x, y, string, MEDIUMFONT, mwindow->theme->edit_font_color));
00429 y += title->get_h() + 5;
00430 }
00431
00432
00433 add_subwindow(title = new BC_Title(x1, y, _("Fix interlacing:")));
00434 add_subwindow(ilacefixoption_chkboxw = new Interlaceautofix(mwindow,this, x2, y));
00435 y += ilacefixoption_chkboxw->get_h() + 5;
00436
00437
00438 add_subwindow(title = new BC_Title(x1, y, _("Asset's interlacing:")));
00439 add_subwindow(textboxw = new AssetEditILacemode(this, "", BC_ILACE_ASSET_MODEDEFAULT, x2, y, 200));
00440 ilacefixoption_chkboxw->ilacemode_textbox = textboxw;
00441 add_subwindow(listboxw = new AssetEditInterlacemodePulldown(mwindow,
00442 textboxw,
00443 &asset->interlace_mode,
00444 (ArrayList<BC_ListBoxItem*>*)&mwindow->interlace_asset_modes,
00445 ilacefixoption_chkboxw,
00446 x2 + textboxw->get_w(),
00447 y));
00448 ilacefixoption_chkboxw->ilacemode_listbox = listboxw;
00449 y += textboxw->get_h() + 5;
00450
00451
00452 add_subwindow(title = new BC_Title(x1, y, _("Interlace correction:")));
00453 add_subwindow(textboxw = new AssetEditILacefixmethod(this, "", BC_ILACE_FIXDEFAULT, x2, y, 200));
00454 ilacefixoption_chkboxw->ilacefixmethod_textbox = textboxw;
00455 add_subwindow(listboxw = new InterlacefixmethodPulldown(mwindow,
00456 textboxw,
00457 &asset->interlace_fixmethod,
00458 (ArrayList<BC_ListBoxItem*>*)&mwindow->interlace_asset_fixmethods,
00459 x2 + textboxw->get_w(),
00460 y));
00461 ilacefixoption_chkboxw->ilacefixmethod_listbox = listboxw;
00462 ilacefixoption_chkboxw->showhideotherwidgets();
00463 y += textboxw->get_h() + 5;
00464
00465 x = x1;
00466 add_subwindow(new BC_Title(x, y, _("Reel Name:")));
00467 x = x2;
00468 add_subwindow(new AssetEditReelName(this, x, y));
00469 y += 30;
00470
00471 x = x1;
00472 add_subwindow(new BC_Title(x, y, _("Reel Number:")));
00473 x = x2;
00474 add_subwindow(new AssetEditReelNumber(this, x, y));
00475 y += 30;
00476
00477 x = x1;
00478 add_subwindow(new BC_Title(x, y, _("Time Code Start:")));
00479 x = x2;
00480
00481
00482 char tc[12];
00483
00484 Units::totext(tc,
00485 asset->tcstart / asset->frame_rate,
00486 TIME_HMSF,
00487 asset->sample_rate,
00488 asset->frame_rate);
00489
00490 char *tc_hours = tc;
00491 char *tc_minutes = strchr(tc, ':') + 1;
00492 *(tc_minutes - 1) = 0;
00493 char *tc_seconds = strchr(tc_minutes, ':') + 1;
00494 *(tc_seconds - 1) = 0;
00495 char *tc_rest = strchr(tc_seconds, ':') + 1;
00496 *(tc_rest - 1) = 0;
00497
00498 add_subwindow(new AssetEditTCStartTextBox(this, atoi(tc_hours), x, y,
00499 (int) (asset->frame_rate * 60 * 60)));
00500 x += 30;
00501 add_subwindow(new BC_Title(x, y, ":"));
00502 x += 10;
00503 add_subwindow(new AssetEditTCStartTextBox(this, atoi(tc_minutes), x, y,
00504 (int) (asset->frame_rate * 60)));
00505 x += 30;
00506 add_subwindow(new BC_Title(x, y, ":"));
00507 x += 10;
00508 add_subwindow(new AssetEditTCStartTextBox(this, atoi(tc_seconds), x, y,
00509 (int) (asset->frame_rate)));
00510 x += 30;
00511 add_subwindow(new BC_Title(x, y, ":"));
00512 x += 10;
00513 add_subwindow(new AssetEditTCStartTextBox(this, atoi(tc_rest), x, y, 1));
00514
00515
00516 y += 30;
00517 }
00518
00519 add_subwindow(new BC_OKButton(this));
00520 add_subwindow(new BC_CancelButton(this));
00521 show_window();
00522 flush();
00523 return 0;
00524 }
00525
00526 AssetEditChannels::AssetEditChannels(AssetEditWindow *fwindow,
00527 char *text,
00528 int x,
00529 int y)
00530 : BC_TumbleTextBox(fwindow,
00531 (int)atol(text),
00532 (int)1,
00533 (int)MAXCHANNELS,
00534 x,
00535 y,
00536 50)
00537 {
00538 this->fwindow = fwindow;
00539 }
00540
00541 int AssetEditChannels::handle_event()
00542 {
00543 fwindow->asset->channels = atol(get_text());
00544 return 1;
00545 }
00546
00547 AssetEditRate::AssetEditRate(AssetEditWindow *fwindow, char *text, int x, int y)
00548 : BC_TextBox(x, y, 100, 1, text)
00549 {
00550 this->fwindow = fwindow;
00551 }
00552
00553 int AssetEditRate::handle_event()
00554 {
00555 fwindow->asset->sample_rate = atol(get_text());
00556 return 1;
00557 }
00558
00559 AssetEditFRate::AssetEditFRate(AssetEditWindow *fwindow, char *text, int x, int y)
00560 : BC_TextBox(x, y, 100, 1, text)
00561 {
00562 this->fwindow = fwindow;
00563 }
00564
00565 int AssetEditFRate::handle_event()
00566 {
00567 fwindow->asset->frame_rate = atof(get_text());
00568 return 1;
00569 }
00570
00571 Interlaceautofix::Interlaceautofix(MWindow *mwindow,AssetEditWindow *fwindow, int x, int y)
00572 : BC_CheckBox(x, y, fwindow->asset->interlace_autofixoption, _("Automatically Fix Interlacing"))
00573 {
00574 this->fwindow = fwindow;
00575 this->mwindow = mwindow;
00576 }
00577
00578 Interlaceautofix::~Interlaceautofix()
00579 {
00580 }
00581
00582 int Interlaceautofix::handle_event()
00583 {
00584 fwindow->asset->interlace_autofixoption = get_value();
00585 showhideotherwidgets();
00586 return 1;
00587 }
00588
00589 void Interlaceautofix::showhideotherwidgets()
00590 {
00591 int thevalue = get_value();
00592
00593 if (thevalue == BC_ILACE_AUTOFIXOPTION_AUTO)
00594 {
00595 this->ilacemode_textbox->enable();
00596 this->ilacemode_listbox->enable();
00597 this->ilacefixmethod_textbox->disable();
00598 this->ilacefixmethod_listbox->disable();
00599 int xx = ilaceautofixmethod(mwindow->edl->session->interlace_mode,fwindow->asset->interlace_mode);
00600 ilacefixmethod_to_text(string,xx);
00601 this->ilacefixmethod_textbox->update(string);
00602 }
00603 if (thevalue == BC_ILACE_AUTOFIXOPTION_MANUAL)
00604 {
00605 this->ilacemode_textbox->disable();
00606 this->ilacemode_listbox->disable();
00607 this->ilacefixmethod_textbox->enable();
00608 this->ilacefixmethod_listbox->enable();
00609 ilacefixmethod_to_text(string,fwindow->asset->interlace_fixmethod);
00610 this->ilacefixmethod_textbox->update(string);
00611 }
00612 }
00613
00614 InterlacefixmethodItem::InterlacefixmethodItem(char *text, int value)
00615 : BC_ListBoxItem(text)
00616 {
00617 this->value = value;
00618 }
00619
00620 InterlacefixmethodPulldown::InterlacefixmethodPulldown(MWindow *mwindow,
00621 BC_TextBox *output_text,
00622 int *output_value,
00623 ArrayList<BC_ListBoxItem*> *data,
00624 int x,
00625 int y)
00626 : BC_ListBox(x,
00627 y,
00628 200,
00629 150,
00630 LISTBOX_TEXT,
00631 data,
00632 0,
00633 0,
00634 1,
00635 0,
00636 1)
00637 {
00638 char string[BCTEXTLEN];
00639
00640 this->mwindow = mwindow;
00641 this->output_text = output_text;
00642 this->output_value = output_value;
00643 output_text->update(interlacefixmethod_to_text());
00644 }
00645
00646 int InterlacefixmethodPulldown::handle_event()
00647 {
00648 output_text->update(get_selection(0, 0)->get_text());
00649 *output_value = ((InterlacefixmethodItem*)get_selection(0, 0))->value;
00650 return 1;
00651 }
00652
00653 char* InterlacefixmethodPulldown::interlacefixmethod_to_text()
00654 {
00655 ilacefixmethod_to_text(this->string,*output_value);
00656 return (this->string);
00657 }
00658
00659 AssetEditILaceautofixoption::AssetEditILaceautofixoption(AssetEditWindow *fwindow, char *text, int thedefault, int x, int y, int w)
00660 : BC_TextBox(x, y, w, 1, text)
00661 {
00662 this->fwindow = fwindow;
00663 this->thedefault = thedefault;
00664 }
00665
00666 int AssetEditILaceautofixoption::handle_event()
00667 {
00668 fwindow->asset->interlace_autofixoption = ilaceautofixoption_from_text(get_text(), this->thedefault);
00669 return 1;
00670 }
00671
00672
00673 AssetEditILacemode::AssetEditILacemode(AssetEditWindow *fwindow, char *text, int thedefault, int x, int y, int w)
00674 : BC_TextBox(x, y, w, 1, text)
00675 {
00676 this->fwindow = fwindow;
00677 this->thedefault = thedefault;
00678 }
00679
00680 int AssetEditILacemode::handle_event()
00681 {
00682 fwindow->asset->interlace_mode = ilacemode_from_text(get_text(),this->thedefault);
00683 return 1;
00684 }
00685
00686 AssetEditInterlacemodePulldown::AssetEditInterlacemodePulldown(MWindow *mwindow,
00687 BC_TextBox *output_text,
00688 int *output_value,
00689 ArrayList<BC_ListBoxItem*> *data,
00690 Interlaceautofix *fixoption_chkboxw,
00691 int x,
00692 int y)
00693 : BC_ListBox(x,
00694 y,
00695 200,
00696 150,
00697 LISTBOX_TEXT,
00698 data,
00699 0,
00700 0,
00701 1,
00702 0,
00703 1)
00704 {
00705 char string[BCTEXTLEN];
00706 this->fixoption_chkbox = fixoption_chkboxw;
00707 this->mwindow = mwindow;
00708 this->output_text = output_text;
00709 this->output_value = output_value;
00710 output_text->update(interlacemode_to_text());
00711 }
00712
00713 int AssetEditInterlacemodePulldown::handle_event()
00714 {
00715 output_text->update(get_selection(0, 0)->get_text());
00716 *output_value = ((InterlacemodeItem*)get_selection(0, 0))->value;
00717 fixoption_chkbox->showhideotherwidgets();
00718 return 1;
00719 }
00720
00721 char* AssetEditInterlacemodePulldown::interlacemode_to_text()
00722 {
00723 ilacemode_to_text(this->string,*output_value);
00724 return (this->string);
00725 }
00726
00727 AssetEditILacefixmethod::AssetEditILacefixmethod(AssetEditWindow *fwindow, char *text, int thedefault, int x, int y, int w)
00728 : BC_TextBox(x, y, w, 1, text)
00729 {
00730 this->fwindow = fwindow;
00731 this->thedefault = thedefault;
00732 }
00733
00734 int AssetEditILacefixmethod::handle_event()
00735 {
00736 fwindow->asset->interlace_fixmethod = ilacefixmethod_from_text(get_text(),this->thedefault);
00737 return 1;
00738 }
00739
00740 AssetEditHeader::AssetEditHeader(AssetEditWindow *fwindow, char *text, int x, int y)
00741 : BC_TextBox(x, y, 100, 1, text)
00742 {
00743 this->fwindow = fwindow;
00744 }
00745
00746 int AssetEditHeader::handle_event()
00747 {
00748 fwindow->asset->header = atol(get_text());
00749 return 1;
00750 }
00751
00752 AssetEditByteOrderLOHI::AssetEditByteOrderLOHI(AssetEditWindow *fwindow,
00753 int value,
00754 int x,
00755 int y)
00756 : BC_Radial(x, y, value, _("Lo-Hi"))
00757 {
00758 this->fwindow = fwindow;
00759 }
00760
00761 int AssetEditByteOrderLOHI::handle_event()
00762 {
00763 fwindow->asset->byte_order = 1;
00764 fwindow->hilo->update(0);
00765 update(1);
00766 return 1;
00767 }
00768
00769 AssetEditByteOrderHILO::AssetEditByteOrderHILO(AssetEditWindow *fwindow,
00770 int value,
00771 int x,
00772 int y)
00773 : BC_Radial(x, y, value, _("Hi-Lo"))
00774 {
00775 this->fwindow = fwindow;
00776 }
00777
00778 int AssetEditByteOrderHILO::handle_event()
00779 {
00780 fwindow->asset->byte_order = 0;
00781 fwindow->lohi->update(0);
00782 update(1);
00783 return 1;
00784 }
00785
00786 AssetEditSigned::AssetEditSigned(AssetEditWindow *fwindow,
00787 int value,
00788 int x,
00789 int y)
00790 : BC_CheckBox(x, y, value, _("Values are signed"))
00791 {
00792 this->fwindow = fwindow;
00793 }
00794
00795 int AssetEditSigned::handle_event()
00796 {
00797 fwindow->asset->signed_ = get_value();
00798 return 1;
00799 }
00800
00801
00802
00803
00804
00805
00806