~mixxxdevelopers/mixxx/features_library_scanner

« back to all changes in this revision

Viewing changes to mixxx/mixxx/enginebuffer.h

  • Committer: tuehaste
  • Date: 2002-02-26 11:12:07 UTC
  • Revision ID: vcs-imports@canonical.com-20020226111207-5rly26cj9gdd19ba
Initial revision

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
                          enginebuffer.h  -  description
 
3
                             -------------------
 
4
    begin                : Wed Feb 20 2002
 
5
    copyright            : (C) 2002 by Tue and Ken Haste Andersen
 
6
    email                : 
 
7
 ***************************************************************************/
 
8
 
 
9
/***************************************************************************
 
10
 *                                                                         *
 
11
 *   This program is free software; you can redistribute it and/or modify  *
 
12
 *   it under the terms of the GNU General Public License as published by  *
 
13
 *   the Free Software Foundation; either version 2 of the License, or     *
 
14
 *   (at your option) any later version.                                   *
 
15
 *                                                                         *
 
16
 ***************************************************************************/
 
17
 
 
18
#ifndef ENGINEBUFFER_H
 
19
#define ENGINEBUFFER_H
 
20
 
 
21
#include <qthread.h>
 
22
#include <qpushbutton.h>
 
23
#include <qmultilineedit.h>
 
24
#include <qslider.h>
 
25
#include <qstring.h>
 
26
 
 
27
#include <pthread.h>
 
28
#include <semaphore.h>
 
29
 
 
30
#include "defs.h"
 
31
#include "engineobject.h"
 
32
#include "soundsource.h"
 
33
#include "controlpushbutton.h"
 
34
#include "controlpotmeter.h"
 
35
#include "dlgplaycontrol.h"
 
36
#include "dlgchannel.h"
 
37
#include "dlgmessages.h"
 
38
#include "midiobject.h"
 
39
/**
 
40
  *@author Tue and Ken Haste Andersen
 
41
  */
 
42
 
 
43
class EngineBuffer : public EngineObject, public QThread  {
 
44
 Q_OBJECT
 
45
private:
 
46
  void run();
 
47
 
 
48
  //DlgPlaycontrol *playcontrol;
 
49
  //QMultiLineEdit *messages;
 
50
  ControlPushButton *PlayButton;
 
51
  ControlPotmeter *rateSlider;
 
52
  double rate;
 
53
  SoundSource *file;
 
54
  SAMPLE *temp;
 
55
  unsigned  chunk_size;
 
56
  unsigned long int filepos;
 
57
  FLOAT filelength;
 
58
  int direction;
 
59
  long distance(const long, const long);
 
60
  FLOAT min(const FLOAT, const FLOAT);
 
61
  FLOAT max(const FLOAT, const FLOAT);
 
62
public:
 
63
  EngineBuffer(DlgPlaycontrol *, DlgChannel *, MidiObject *, char *);
 
64
  ~EngineBuffer();
 
65
  void start();
 
66
  void process(CSAMPLE *, CSAMPLE *, int);
 
67
  sem_t *buffers_read_ahead;
 
68
  unsigned long int read_buffer_size;
 
69
  unsigned long int frontpos;
 
70
  double play_pos;
 
71
  CSAMPLE *readbuffer;
 
72
  void getchunk();
 
73
  void seek(FLOAT);
 
74
  void checkread();
 
75
  void writepos();
 
76
public slots:
 
77
   void slotUpdatePlay(valueType);
 
78
   void slotUpdateRate(FLOAT);
 
79
};
 
80
#endif