aldweb

Fermer I. aldweb

Fermer II. Gratuitiels PC

Fermer III. Gratuitiels Palm

Fermer IV. Partagiciels Palm

Fermer V. iziBasic Palm

Fermer VI. Connaissance Palm

Fermer VII. Ordinateur Poche

Fermer VIII. miniPortail

Spécial !



Version mobile
de l'aldweb Site

m.aldweb.com


Ni Français, ni Anglais ?

Essayez donc l'un de ces drapeaux :
[de] [es] [it] [pt]
Recherche




Météo / Spam / www

Météo Lyon


aldweb contre le SPAM


Newsletter
Pour avoir des nouvelles de ce site, inscrivez-vous à notre Newsletter.
S'abonner
Se désabonner
298 Abonnés
Sites web de la famille

Webmaster - Infos
News Amis
Visites

   visiteurs

   visiteurs en ligne

Sondage
Comment trouve-tu le nouvel habillage de l'aldweb Site ?
 
Superbe !
Joli
Moyen
Moche...
Résultats
forum.gifForum - iziBasic - Sujet n°1488

Forum - Forum
iziBasic - iziBasic


Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257

actif  Sujet n° 1488  PLAYWAVE respecting system prefs

le 20/11/2006 @ 08:29
par Dave O\'Brien

Anonyme



I thought I posted this a few days ago, but maybe it got eaten somehow. I'll try again:

I was experimenting with the PLAYWAVE command, and noticed that it plays the sound even if the Palm sound prefs are muted. (The BEEP command respects the prefs already.)

My wish (you can see this one coming, I bet) is either to:
- let the PLAYWAVE command respect the system settings (either always or with a switch), or
- provide a way to get the system prefs so I can mute PLAYWAVE commands myself.

Otherwise I'll give myself away when playing Minesweeper in a meeting. ;^)
  Poster une réponse  Haut

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 1
--------
le 22/11/2006 @ 14:21
par aldweb

Anonyme

visiteur
Hello Dave,

For sure, I don't want you to get in trouble because of playing Sweeper in a meeting... and I don't want to be fired either when playing your game in a boring meeting too!

So, here is a good way to figure out if the sound should be played or not, the trick is one more time to develop a quick PP applet.
So, please find in preview one of the sample PP applets package that I plan to release pretty soon.

The PP applet itself:
{
SoundPref.pas
'PP applet' for iziBasic
Version 1.0ß1 - November 20, 2006
by Laurent Duveau
Web Site = http://www.aldweb.com


----------------------
What is SoundPref.pas?
----------------------

SoundPref.pas is a fully featured 'PP applet' for iziBasic which
is made to retrieve sound preferences from PalmOS system
preferences.
This applet can easily be extended to retrieve other system
preferences, as all system preferences up to Palm OS version 5.3
are defined.

This 'PP applet' can be used as is in your iziBasic projects.
Please give a look to the SoundPref.ibas sample program source
code to see an example of how to access it.


-------------------------
How to use SoundPref.pas?
-------------------------

SYNTAX

output$ = CALLPP$(100,input$)
input$ : "System" or "Game" or "Alarm"
output$: "0" if sound is Off
"8" if sound is Low
"32" if sound is Medium
"64" if sound is High
"-1" if error


-------------------------------
Parametrization and integration
in an iziBasic project
-------------------------------

Step #1: Replace the 'LDSP' CreatorID in the first line of the
source code below to the CreatorID defined in your
iziBasic source code (see CREATORID compiling directive)
Also replace the 'SoundPref' label in the second line
to the name of your application (the part of the iziBasic
source code file name prior to the '.ibas' extension)

Step #2: Compile your iziBasic project

Step #3: Compile this 'PP applet'
}

{$code appl,LDSP,code,100}
program SoundPref;
type iBasFunType=function(S:string):string;
var iBasCallPP:iBasFunType;

type
SystemPreferencesChoice=(
prefVersion,
prefCountry,
prefDateFormat,
prefLongDateFormat,
prefWeekStartDay,
prefTimeFormat,
prefNumberFormat,
prefAutoOffDuration,
prefSysSoundLevelV20,
prefGameSoundLevelV20,
prefAlarmSoundLevelV20,
prefHidePrivateRecordsV33,
prefDeviceLocked,
prefLocalSyncRequiresPassword,
prefRemoteSyncRequiresPassword,
prefSysBatteryKind,
prefAllowEasterEggs,
prefMinutesWestOfGMT,
prefDaylightSavings,
prefRonamaticChar,
prefHard1CharAppCreator,
prefHard2CharAppCreator,
prefHard3CharAppCreator,
prefHard4CharAppCreator,
prefCalcCharAppCreator,
prefHardCradleCharAppCreator,
prefLauncherAppCreator,
prefSysPrefFlags,
prefHardCradle2CharAppCreator,
prefAnimationLevel,
prefSysSoundVolume,
prefGameSoundVolume,
prefAlarmSoundVolume,
prefBeamReceive,
prefCalibrateDigitizerAtReset,
prefSystemKeyboardID,
prefDefSerialPlugIn,
// Additions for PalmOS 3.1:
prefStayOnWhenPluggedIn,
prefStayLitWhenPluggedIn,
// Additions for PalmOS 3.2:
prefAntennaCharAppCreator,
// Additions for PalmOS 3.3:
prefMeasurementSystem,
// Additions for PalmOS 3.5:
prefShowPrivateRecords,
prefAutoOffDurationSecs,
// Additions for PalmOS 4.0:
prefTimeZone,
prefDaylightSavingAdjustment,
prefAutoLockType,
prefAutoLockTime,
prefAutoLockTimeFlag,
prefLanguage,
prefLocale,
prefTimeZoneCountry,
prefAttentionFlags,
prefDefaultAppCreator,
// Additions for PalmOS 5.0:
prefDefFepPlugInCreator,
// Additions for PalmOS 5.1:
prefColorThemeID,
// Additions for PalmOS 5.3
prefHandednessChoice,
prefHWRCreator);


function PrefGetPreference(whichPref:SystemPreferencesChoice):integer; inline($4E4F,$A2D1);
procedure StrIToA(var S:string;N:integer); inline($4E4F,$A0C9);

function IntToString(i:integer):string;
var
sResult:string;
begin
StrIToA(sResult,i);
IntToString:=sResult;
end;

function CallPP(S:string):string;
var
MySound:integer;
begin
if S='System' then
MySound:=PrefGetPreference(prefSysSoundVolume)
else
if S='Game' then
MySound:=PrefGetPreference(prefGameSoundVolume)
else
if S='Alarm' then
MySound:=PrefGetPreference(prefAlarmSoundVolume)
else
MySound:=-1; // error
CallPP:=IntToString(MySound);
end;

begin
iBasCallPP:=CallPP;
end.

Ecrire à aldweb   Poster une réponse  Haut

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 2
--------
le 22/11/2006 @ 14:40
par aldweb

Anonyme

visiteur
And an iziBasic sample code to retrieve and manage the information exchanged with the PP applet:
' SoundPref.ibas
' Version 1.0ß1 - November 20, 2006
' by Laurent Duveau
' Web Site = http://www.aldweb.com

{CREATORID "LDSP"}
{VERSION "1.0"}
'{MINOSVERSION "3.0"}
'{PARSER OFF}
'{KEYEVENTS OFF}
'{SECUREFILES ON}


BEGIN
S$="System"
A$=CALLPP$(100,S$)
GOSUB _Result

S$="Game"
A$=CALLPP$(100,S$)
GOSUB _Result

S$="Alarm"
A$=CALLPP$(100,S$)
GOSUB _Result

S$="Windows" '
A$=CALLPP$(100,S$)
GOSUB _Result

WAIT
END

_Result:
PRINT S$;
PRINT " sound is ";
IF A$="-1" PRINT "-- error! --"
IF A$="0" PRINT "Off"
IF A$="8" PRINT "On - Low"
IF A$="32" PRINT "On - Medium"
IF A$="64" PRINT "On - High"
RETURN


I am always amazed by the concision and the clarity of an iziBasic source code...

By the way, Dave, let me congratulate you for releasing a first version of Sweeper to the whole world, from PalmGear to FreewarePalm.
This is the one quality made game that my Tungsten C had always been missing and it kept requiring me to acquire one (yes my device talks to me! ).

Cheers,
aldweb
Ecrire à aldweb   Poster une réponse  Haut
actif sujet actif   clos sujet clos   Important! Important!   Nouveau Nouveau message   -   Rectifier Rectifier message   Clôturer Clôturer sujet   Remonter Remonter
[]
Catégories de discussion  Forum 



 
^ Haut ^