~ubuntu-branches/ubuntu/saucy/flac/saucy

« back to all changes in this revision

Viewing changes to src/plugin_winamp3/cnv_flacpcm.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Matt Zimmerman
  • Date: 2001-12-10 03:09:22 UTC
  • Revision ID: james.westby@ubuntu.com-20011210030922-0vdtpz6a7mfwefo5
Tags: upstream-1.0.2
ImportĀ upstreamĀ versionĀ 1.0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* FLAC input plugin for Winamp3
 
2
 * Copyright (C) 2000,2001  Josh Coalson
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU General Public License
 
6
 * as published by the Free Software Foundation; either version 2
 
7
 * of the License, or (at your option) any later version.
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software
 
16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
17
 *
 
18
 * NOTE: this code is derived from the 'rawpcm' example by
 
19
 * Nullsoft; the original license for the 'rawpcm' example follows.
 
20
 */
 
21
/*
 
22
 
 
23
  Nullsoft WASABI Source File License
 
24
 
 
25
  Copyright 1999-2001 Nullsoft, Inc.
 
26
 
 
27
    This software is provided 'as-is', without any express or implied
 
28
    warranty.  In no event will the authors be held liable for any damages
 
29
    arising from the use of this software.
 
30
 
 
31
    Permission is granted to anyone to use this software for any purpose,
 
32
    including commercial applications, and to alter it and redistribute it
 
33
    freely, subject to the following restrictions:
 
34
 
 
35
    1. The origin of this software must not be misrepresented; you must not
 
36
       claim that you wrote the original software. If you use this software
 
37
       in a product, an acknowledgment in the product documentation would be
 
38
       appreciated but is not required.
 
39
    2. Altered source versions must be plainly marked as such, and must not be
 
40
       misrepresented as being the original software.
 
41
    3. This notice may not be removed or altered from any source distribution.
 
42
 
 
43
 
 
44
  Brennan Underwood
 
45
  brennan@nullsoft.com
 
46
 
 
47
*/
 
48
 
 
49
#include "cnv_flacpcm.h"
 
50
#include "flacpcm.h"
 
51
 
 
52
static WACNAME wac;
 
53
WAComponentClient *the = &wac;
 
54
 
 
55
#include "studio/services/servicei.h"
 
56
static waServiceT<svc_mediaConverter, FlacPcm> flacpcm;
 
57
 
 
58
// {683FA153-4055-467c-ABEE-5E35FA03C51E}
 
59
static const GUID guid = 
 
60
{ 0x683fa153, 0x4055, 0x467c, { 0xab, 0xee, 0x5e, 0x35, 0xfa, 0x3, 0xc5, 0x1e } };
 
61
 
 
62
_int nch;
 
63
_int samplerate;
 
64
_int bps;
 
65
 
 
66
WACNAME::WACNAME() : CfgItemI("RAW files support") {
 
67
#ifdef FORTIFY
 
68
        FortifySetName("cnv_flacpcm.wac");
 
69
        FortifyEnterScope();
 
70
#endif
 
71
}
 
72
 
 
73
WACNAME::~WACNAME() {
 
74
#ifdef FORTIFY
 
75
        FortifyLeaveScope();
 
76
#endif
 
77
}
 
78
 
 
79
GUID WACNAME::getGUID() {
 
80
        return guid;
 
81
}
 
82
 
 
83
void WACNAME::onRegisterServices() {
 
84
        api->service_register(&flacpcm);
 
85
        api->core_registerExtension("*.flac","FLAC Files");
 
86
 
 
87
        nch.setName("# of channels");
 
88
        nch=2;
 
89
        registerAttribute(&nch);
 
90
        samplerate.setName("Sample rate");
 
91
        samplerate=44100;
 
92
        registerAttribute(&samplerate);
 
93
        bps.setName("Bits per second");
 
94
        bps=16;
 
95
        registerAttribute(&bps);
 
96
}
 
97
 
 
98
void WACNAME::onDestroy() {
 
99
        api->service_deregister(&flacpcm);
 
100
        WAComponentClient::onDestroy();
 
101
}