xue@0
|
1 /*
|
xue@0
|
2 Harmonic Visualiser
|
xue@0
|
3
|
xue@0
|
4 An audio file viewer and editor.
|
xue@0
|
5 Centre for Digital Music, Queen Mary, University of London.
|
xue@0
|
6 This file copyright 2011 Wen Xue.
|
xue@0
|
7
|
xue@0
|
8 This program is free software; you can redistribute it and/or
|
xue@0
|
9 modify it under the terms of the GNU General Public License as
|
xue@0
|
10 published by the Free Software Foundation; either version 2 of the
|
xue@0
|
11 License, or (at your option) any later version.
|
xue@0
|
12 */
|
xue@0
|
13 //---------------------------------------------------------------------------
|
xue@0
|
14
|
xue@0
|
15 #include <vcl.h>
|
xue@0
|
16 #pragma hdrstop
|
xue@0
|
17
|
xue@0
|
18 #include "SUThread.h"
|
xue@0
|
19 #include "hs.h"
|
xue@0
|
20 #pragma package(smart_init)
|
xue@0
|
21 //---------------------------------------------------------------------------
|
xue@0
|
22
|
xue@0
|
23 // Important: Methods and properties of objects in VCL can only be
|
xue@0
|
24 // used in a method called using Synchronize, for example:
|
xue@0
|
25 //
|
xue@0
|
26 // Synchronize(UpdateCaption);
|
xue@0
|
27 //
|
xue@0
|
28 // where UpdateCaption could look like:
|
xue@0
|
29 //
|
xue@0
|
30 // void __fastcall TSUThread::UpdateCaption()
|
xue@0
|
31 // {
|
xue@0
|
32 // Form1->Caption = "Updated in a thread";
|
xue@0
|
33 // }
|
xue@0
|
34 //---------------------------------------------------------------------------
|
xue@0
|
35
|
xue@0
|
36 __fastcall TSUThread::TSUThread(bool CreateSuspended)
|
xue@0
|
37 : TThread(CreateSuspended)
|
xue@0
|
38 {
|
xue@0
|
39 xrec=0;
|
xue@0
|
40 data=0;
|
xue@0
|
41 sf=false;
|
xue@0
|
42 HS=0;
|
xue@0
|
43 }
|
xue@0
|
44
|
xue@0
|
45 __fastcall TSUThread::~TSUThread()
|
xue@0
|
46 {
|
xue@0
|
47 free8(xrec);
|
xue@0
|
48 delete[] data;
|
xue@0
|
49 delete HS;
|
xue@0
|
50 }
|
xue@0
|
51
|
xue@0
|
52
|
xue@0
|
53 //---------------------------------------------------------------------------
|
xue@0
|
54 void __fastcall TSUThread::Execute()
|
xue@0
|
55 {
|
xue@0
|
56 //---- Place thread code here ----
|
xue@0
|
57 xrec=SynthesisHS(HS, dst, den, &Terminated);
|
xue@0
|
58 }
|
xue@0
|
59 //---------------------------------------------------------------------------
|