2 |
* * |
* * |
3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003 by Benno Senoner * |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
6 |
|
* Copyright (C) 2005 Christian Schoenebeck * |
7 |
* * |
* * |
8 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
9 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
33 |
#define REFILL_STREAMS_PER_RUN 4 ///< number of streams that should be refilled with each disk thread cycle |
#define REFILL_STREAMS_PER_RUN 4 ///< number of streams that should be refilled with each disk thread cycle |
34 |
#define MIN_REFILL_SIZE 1024 ///< if no buffer was filled up more than this bottom limit, the disk thread will go to sleep |
#define MIN_REFILL_SIZE 1024 ///< if no buffer was filled up more than this bottom limit, the disk thread will go to sleep |
35 |
#define MAX_REFILL_SIZE 65536 ///< maximum of samples a buffer should be refilled in one cycle (256kB, as 16 bit stereo) |
#define MAX_REFILL_SIZE 65536 ///< maximum of samples a buffer should be refilled in one cycle (256kB, as 16 bit stereo) |
36 |
#define STREAM_BUFFER_SIZE 131072 ///< the diskstream ringbuffer size (256kB as sample_t is 16bit) |
|
37 |
#define MAX_INPUT_STREAMS 100 ///< number of streams that should be allocated |
|
38 |
|
//#define STREAM_BUFFER_SIZE 131072 ///< the diskstream ringbuffer size (256kB as sample_t is 16bit) |
39 |
|
|
40 |
|
#define STREAM_BUFFER_SIZE 262144 |
41 |
|
//#define MAX_INPUT_STREAMS 150 ///< number of streams that should be allocated |
42 |
|
|
43 |
|
#define MAX_INPUT_STREAMS 90 ///< number of streams that should be allocated |
44 |
|
|
45 |
|
|
46 |
#include "../../common/Thread.h" |
#include "../../common/Thread.h" |
47 |
#include "../../common/RingBuffer.h" |
#include "../../common/RingBuffer.h" |
48 |
|
#include "../../lib/fileloader/libgig/gig.h" |
49 |
#include "Stream.h" |
#include "Stream.h" |
50 |
#include "Voice.h" |
#include "Voice.h" |
51 |
|
|
57 |
public: |
public: |
58 |
// Methods |
// Methods |
59 |
DiskThread(uint BufferWrapElements); |
DiskThread(uint BufferWrapElements); |
60 |
~DiskThread(); |
virtual ~DiskThread(); |
61 |
void Reset(); |
void Reset(); |
62 |
String GetBufferFillBytes(); |
String GetBufferFillBytes(); |
63 |
String GetBufferFillPercentage(); |
String GetBufferFillPercentage(); |
71 |
int ActiveStreamCountMax; |
int ActiveStreamCountMax; |
72 |
|
|
73 |
protected: |
protected: |
74 |
|
::gig::buffer_t DecompressionBuffer; ///< Used for thread safe streaming. |
75 |
|
|
76 |
int Main(); ///< Implementation of virtual method from class Thread |
int Main(); ///< Implementation of virtual method from class Thread |
77 |
|
|
78 |
|
friend class Stream; |
79 |
private: |
private: |
80 |
// Private Types |
// Private Types |
81 |
struct create_command_t { |
struct create_command_t { |