3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
6 |
* Copyright (C) 2005 - 2009 Christian Schoenebeck * |
* Copyright (C) 2005-2008 Christian Schoenebeck * |
7 |
* Copyright (C) 2009 Grigor Iliev * |
* Copyright (C) 2009-2010 Christian Schoenebeck and Grigor Iliev * |
8 |
* * |
* * |
9 |
* This program is free software; you can redistribute it and/or modify * |
* 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 * |
* it under the terms of the GNU General Public License as published by * |
56 |
si.BitDepth = (pSample->GetFrameSize() / pSample->GetChannelCount()) * 8; |
si.BitDepth = (pSample->GetFrameSize() / pSample->GetChannelCount()) * 8; |
57 |
si.TotalFrameCount = pSample->GetTotalFrameCount(); |
si.TotalFrameCount = pSample->GetTotalFrameCount(); |
58 |
|
|
59 |
si.HasLoops = false; // TODO: |
si.HasLoops = pRegion->HasLoop(); |
60 |
si.LoopStart = 0; // TODO: |
si.LoopStart = pRegion->GetLoopStart(); |
61 |
si.LoopLength = 0; // TODO: |
si.LoopLength = pRegion->GetLoopEnd() - pRegion->GetLoopStart(); |
62 |
si.LoopPlayCount = 0; // TODO: |
si.LoopPlayCount = pRegion->GetLoopCount(); |
63 |
si.Unpitched = false; // TODO: |
si.Unpitched = pRegion->pitch_keytrack == 0; |
64 |
return si; |
return si; |
65 |
} |
} |
66 |
|
|
68 |
RegionInfo ri; |
RegionInfo ri; |
69 |
ri.UnityNote = pRegion->pitch_keycenter; |
ri.UnityNote = pRegion->pitch_keycenter; |
70 |
ri.FineTune = pRegion->tune; |
ri.FineTune = pRegion->tune; |
71 |
ri.Pan = pRegion->pan; |
ri.Pan = int(pRegion->pan * 0.63); // convert from -100..100 to -64..63 |
72 |
ri.SampleStartOffset = 0; // TODO: |
ri.SampleStartOffset = 0; // TODO: |
73 |
|
|
74 |
ri.EG1PreAttack = pRegion->ampeg_start * 10; |
ri.EG1PreAttack = pRegion->ampeg_start * 10; |