diff SUThread.cpp @ 0:a6a46af64546

first upload
author wenx <xue.wen@eecs.qmul.ac.uk>
date Wed, 10 Aug 2011 14:55:38 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SUThread.cpp	Wed Aug 10 14:55:38 2011 +0100
@@ -0,0 +1,59 @@
+/*
+    Harmonic Visualiser
+
+    An audio file viewer and editor.
+    Centre for Digital Music, Queen Mary, University of London.
+    This file copyright 2011 Wen Xue.
+
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License as
+    published by the Free Software Foundation; either version 2 of the
+    License, or (at your option) any later version. 
+*/
+//---------------------------------------------------------------------------
+
+#include <vcl.h>
+#pragma hdrstop
+
+#include "SUThread.h"
+#include "hs.h"
+#pragma package(smart_init)
+//---------------------------------------------------------------------------
+
+//   Important: Methods and properties of objects in VCL can only be
+//   used in a method called using Synchronize, for example:
+//
+//      Synchronize(UpdateCaption);
+//
+//   where UpdateCaption could look like:
+//
+//      void __fastcall TSUThread::UpdateCaption()
+//      {
+//        Form1->Caption = "Updated in a thread";
+//      }
+//---------------------------------------------------------------------------
+
+__fastcall TSUThread::TSUThread(bool CreateSuspended)
+  : TThread(CreateSuspended)
+{
+  xrec=0;
+  data=0;
+  sf=false;
+  HS=0;
+}
+
+__fastcall TSUThread::~TSUThread()
+{
+  free8(xrec);
+  delete[] data;
+  delete HS;
+}
+
+
+//---------------------------------------------------------------------------
+void __fastcall TSUThread::Execute()
+{
+  //---- Place thread code here ----
+  xrec=SynthesisHS(HS, dst, den, &Terminated);
+}
+//---------------------------------------------------------------------------