aboutsummaryrefslogtreecommitdiff
path: root/backends/PalmOS/Src/init_pa1lib.cpp
blob: d5b0340cae5f332131134507f96203be5046ea8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <PalmOS.h>
#include <Sonyclie.h>

#include "pa1lib.h"
#include "init_pa1lib.h"

void *sndStateOnFuncP = NULL;
void *sndStateOffFuncP = NULL;

#define SndStateOn(a,b,c)	if (sndStateOnFuncP)((sndStateOnType)(sndStateOnFuncP))(a, b, c);
#define SndStateOff(a)		if (sndStateOffFuncP)((sndStateOffType)(sndStateOffFuncP))(a);

void Pa1libInit(UInt16 vol) {
	Pa1Lib_Open();

	// Doesn't work on T4xx and T6xx series ?
	FtrGet(sonySysFtrCreatorSystem, sonySysFtrNumSystemAOutSndStateOnHandlerP, (UInt32*) &sndStateOnFuncP);
	FtrGet(sonySysFtrCreatorSystem, sonySysFtrNumSystemAOutSndStateOffHandlerP, (UInt32*) &sndStateOffFuncP);

	SndStateOn(aOutSndKindSp, vol, vol);
	SndStateOn(aOutSndKindHp, vol, vol);

	Pa1Lib_devHpVolume(vol, vol);
	Pa1Lib_devSpVolume(vol);
}

void Pa1libRelease() {
	SndStateOff(aOutSndKindSp);
	SndStateOff(aOutSndKindHp);

	Pa1Lib_Close();
}