/[svn]/linuxsampler/trunk/src/engines/gig/DiskThread.cpp
ViewVC logotype

Annotation of /linuxsampler/trunk/src/engines/gig/DiskThread.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3054 - (hide annotations) (download)
Thu Dec 15 12:47:45 2016 UTC (7 years, 4 months ago) by schoenebeck
File size: 3445 byte(s)
* Fixed numerous compiler warnings.
* Bumped version (2.0.0.svn32).

1 schoenebeck 53 /***************************************************************************
2     * *
3     * LinuxSampler - modular, streaming capable sampler *
4     * *
5 iliev 2012 * Copyright (C) 2003,2004 by Benno Senoner and Christian Schoenebeck *
6 schoenebeck 3054 * Copyright (C) 2005-2016 Christian Schoenebeck *
7 iliev 2012 * Copyright (C) 2009 Grigor Iliev *
8 schoenebeck 53 * *
9     * This program is free software; you can redistribute it and/or modify *
10     * it under the terms of the GNU General Public License as published by *
11     * the Free Software Foundation; either version 2 of the License, or *
12     * (at your option) any later version. *
13     * *
14     * This program is distributed in the hope that it will be useful, *
15     * but WITHOUT ANY WARRANTY; without even the implied warranty of *
16     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
17     * GNU General Public License for more details. *
18     * *
19     * You should have received a copy of the GNU General Public License *
20     * along with this program; if not, write to the Free Software *
21     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
22     * MA 02111-1307 USA *
23     ***************************************************************************/
24    
25     #include "DiskThread.h"
26 iliev 2012 #include "Stream.h"
27     #include "../../common/global_private.h"
28 schoenebeck 53
29 iliev 2012 namespace LinuxSampler {
30 schoenebeck 53 // just a placeholder to mark a cell in the pickup array as 'reserved'
31 iliev 2012 template <>
32     LinuxSampler::Stream* LinuxSampler::DiskThreadBase< ::gig::DimensionRegion, gig::InstrumentResourceManager>::SLOT_RESERVED = (LinuxSampler::Stream*) &SLOT_RESERVED;
33 schoenebeck 53
34 iliev 2012 namespace gig {
35 schoenebeck 53
36 schoenebeck 1800 DiskThread::DiskThread(int MaxStreams, uint BufferWrapElements, InstrumentResourceManager* pInstruments) :
37 iliev 2012 DiskThreadBase< ::gig::DimensionRegion, InstrumentResourceManager>(MaxStreams, BufferWrapElements, pInstruments)
38 schoenebeck 1321 {
39 schoenebeck 554 DecompressionBuffer = ::gig::Sample::CreateDecompressionBuffer(CONFIG_STREAM_MAX_REFILL_SIZE);
40 iliev 2012 CreateAllStreams(MaxStreams, BufferWrapElements);
41 schoenebeck 53 }
42    
43     DiskThread::~DiskThread() {
44 schoenebeck 385 ::gig::Sample::DestroyDecompressionBuffer(DecompressionBuffer);
45 schoenebeck 53 }
46    
47 iliev 2012 LinuxSampler::Stream* DiskThread::CreateStream(long BufferSize, uint BufferWrapElements) {
48 schoenebeck 3054 return new Stream(&DecompressionBuffer, (uint)BufferSize, BufferWrapElements); // 131072 sample words
49 schoenebeck 53 }
50    
51 iliev 2012 void DiskThread::LaunchStream (
52     LinuxSampler::Stream* pStream,
53     Stream::Handle hStream,
54     Stream::reference_t* pExportReference,
55     ::gig::DimensionRegion* pRgn,
56     unsigned long SampleOffset,
57     bool DoLoop
58     ) {
59     Stream* pGigStream = dynamic_cast<Stream*>(pStream);
60     if(!pGigStream) throw Exception("Invalid stream type");
61     pGigStream->Launch(hStream, pExportReference, pRgn, SampleOffset, DoLoop);
62 schoenebeck 53 }
63 iliev 2012 }} // namespace LinuxSampler::gig
64 schoenebeck 53

  ViewVC Help
Powered by ViewVC