-
Notifications
You must be signed in to change notification settings - Fork 0
/
FLAControler.cpp
97 lines (93 loc) · 3.67 KB
/
FLAControler.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "FLAControler.h"
#include "FLALib.h"
#include "ImgLib.h"
#include "LBAScreenViewer_main.h"
#include "FullScreen.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
Tfrm_controlers *frm_controlers;
extern TFLAheader FLAheader;
extern vector<TFLA> FLA;
extern Graphics::TBitmap *pBitmap;
int tmp = -1;
//---------------------------------------------------------------------------
__fastcall Tfrm_controlers::Tfrm_controlers(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall Tfrm_controlers::BitBtn2Click(TObject *Sender)
{
if(TrackBar1->Position==FLAheader.numOfFrames-1)
TrackBar1->Position=0;
frm_img->Timer1->Enabled = True;
}
//---------------------------------------------------------------------------
void __fastcall Tfrm_controlers::BitBtn3Click(TObject *Sender)
{
frm_img->Timer1->Enabled = False;
}
//---------------------------------------------------------------------------
void __fastcall Tfrm_controlers::BitBtn4Click(TObject *Sender)
{
frm_img->Timer1->Enabled = False;
loadPaletteFromPtr(FLA[0].flaPalette);
frm_controlers->TrackBar1->Position = 0;
DrawPalette(frm_img->PaintBox2->Canvas);
MakeLBAImage(FLA[0].flaBuffer, 320,200);
DrawLBAImage(frm_img->LBAimg->Canvas);
}
//---------------------------------------------------------------------------
void __fastcall Tfrm_controlers::TrackBar2Change(TObject *Sender)
{
frm_img->Timer1->Interval = TrackBar2->Position;
}
//---------------------------------------------------------------------------
void __fastcall Tfrm_controlers::TrackBar1Change(TObject *Sender)
{
loadPaletteFromPtr(FLA[frm_controlers->TrackBar1->Position].flaPalette);
MakeLBAImage(FLA[frm_controlers->TrackBar1->Position].flaBuffer, 320,200);
/* if(tmp != FLA[frm_controlers->TrackBar1->Position].sampleIdx){
frm_img->MediaPlayer1->Stop();
frm_img->MediaPlayer1->Close();
// frm_img->MediaPlayer1->FileName = ExtractFileDir(Application->ExeName);
frm_img->MediaPlayer1->FileName = "\\flasample\\"+ FLA[frm_controlers->TrackBar1->Position].sampleIdx+1;
frm_img->MediaPlayer1->FileName += ".wav";
ShowMessage(frm_img->MediaPlayer1->FileName);
frm_img->MediaPlayer1->Open(); //play it
frm_img->MediaPlayer1->Play();
tmp = FLA[frm_controlers->TrackBar1->Position].sampleIdx;
}else */
// tmp = FLA[a].sampleIdx; */
if(frm_fullscreen->Showing)
frm_fullscreen->Image1->Canvas->Draw(0,0,pBitmap);
else{
DrawPalette(frm_img->PaintBox2->Canvas);
DrawLBAImage(frm_img->LBAimg->Canvas);
}
}
//---------------------------------------------------------------------------
void __fastcall Tfrm_controlers::BitBtn1Click(TObject *Sender)
{
TrackBar1->Position--;
}
//---------------------------------------------------------------------------
void __fastcall Tfrm_controlers::BitBtn6Click(TObject *Sender)
{
TrackBar1->Position=0;
}
//---------------------------------------------------------------------------
void __fastcall Tfrm_controlers::BitBtn5Click(TObject *Sender)
{
TrackBar1->Position++;
}
//---------------------------------------------------------------------------
void __fastcall Tfrm_controlers::BitBtn7Click(TObject *Sender)
{
TrackBar1->Position = FLAheader.numOfFrames-1;
}
//---------------------------------------------------------------------------