Search found 1250 matches

by collectordave
Wed Nov 23, 2022 2:22 pm
Forum: Coding Questions
Topic: Wrong amount returned by FileSize()
Replies: 17
Views: 2421

Re: Wrong amount returned by FileSize()

Yes it does appear that Apple have decided that there are 1000 bytes in a kilobyte etc.

So 50 years of learning that there are 1024 bytes in a kilobyte all for nothing.

Apple cheating me out of 2.5% of storage space?
by collectordave
Wed Nov 23, 2022 10:02 am
Forum: Coding Questions
Topic: Wrong amount returned by FileSize()
Replies: 17
Views: 2421

Re: Wrong amount returned by FileSize()

Seems to be same problem. Maybe a little confused. I have a file on my hard drive which in finder is shown with a size of 16,3MB. When I use FileSize() on the file it returns 16295002 which I assume are bytes Now I thought that there are 1048576 bytes in a mega byte so in 16,3MB should there not be ...
by collectordave
Tue Nov 08, 2022 3:38 pm
Forum: Coding Questions
Topic: [SOLVED] Path separators #PS, #NPS, #PS$, #NPS$
Replies: 8
Views: 494

Re: Path separators #PS, #NPS, #PS$, #NPS$

I have found that #PS$ returns "\" on windows and "/" on the Mac which seems to be correct.

Can anyone explain the use of #NPS$ it is the N which is getting me.
by collectordave
Mon Sep 05, 2022 9:27 am
Forum: Coding Questions
Topic: Vector drawing clear image to transparent
Replies: 0
Views: 328

Vector drawing clear image to transparent

Is it possible to clear an image to transparent using the vector drawing commands? I start with a transparent image add a box then try to clear the image but the box remains. the code I am using: StartVectorDrawing(ImageVectorOutput(DrawImg)) VectorSourceColor(RGBA(255,255,255,0)) FillVectorOutput()...
by collectordave
Sun Sep 04, 2022 2:42 pm
Forum: Coding Questions
Topic: uneven gauge?
Replies: 14
Views: 1088

Re: uneven gauge?

When you something which just cannot be expressed as a linear or exponential function such as in your case the way to go is to use a lookup table. For example Your value Gauge Value 0 0 0.1 50 1 100 10 150 100 200 500 250 1000 300 You can keep adding pairs of values up to the gauge limit of 300 for ...
by collectordave
Sun Sep 04, 2022 9:50 am
Forum: Coding Questions
Topic: uneven gauge?
Replies: 14
Views: 1088

Re: uneven gauge?

As a small example to display % First a small procedure to change your % value to 0-300 Procedure.i DisplayPercent(Value.i) Define Result.f Result = (Value/100) * 300 ProcedureReturn Result EndProcedure Then in the event loop add this If Event = #PB_Event_Timer And EventTimer() = 123 If iLoop > -1 D...
by collectordave
Sun Sep 04, 2022 9:08 am
Forum: Coding Questions
Topic: uneven gauge?
Replies: 14
Views: 1088

Re: uneven gauge?

Just rescued some code. Draws a circular gauge with pointer first up to maximum (300) then back to zero Any use? Global Pathx,Pathy Global Reverse.i Procedure DrawGauge(Value.i) Define EndAngle.i EndAngle = 120 + Value If EndAngle > 360 EndAngle = EndAngle - 360 EndIf If StartVectorDrawing(CanvasVec...
by collectordave
Fri Sep 02, 2022 8:02 am
Forum: Coding Questions
Topic: m3u playlists
Replies: 1
Views: 945

Re: m3u playlists

Long time to wait for a reply but just in case any other novices end up here as I did check out this thread. https://www.purebasic.fr/english/viewtopic.php?p=566557&hilit=playlists#p566557 M3U are a list of file names so read them find the files and play as normal. the routines from kenmo work w...
by collectordave
Fri Sep 02, 2022 7:16 am
Forum: Bugs - Mac OSX
Topic: [Done] GetSoundPosition returns -1
Replies: 8
Views: 1142

Re: GetSoundPosition returns -1

Just tried playing multiple tracks one after the other and it appears that StopSound() does release the channel. After playing nearly 50 tracks the channel used stays the same when each one is terminated by StopSound() Just a matter of adding the channel number to the player will solve the problem o...
by collectordave
Fri Sep 02, 2022 6:54 am
Forum: Bugs - Mac OSX
Topic: [Done] GetSoundPosition returns -1
Replies: 8
Views: 1142

Re: GetSoundPosition returns -1

If I am reading the help correctly the multichannel flag opens a new channel each time a sound is played. Are these channels closed when stopping a sound or freeing a sound? If not how can an unused channel be released? As an example I have just over 40,000 .ogg files and when playing music may want...
by collectordave
Fri Sep 02, 2022 3:17 am
Forum: Bugs - Mac OSX
Topic: [Done] GetSoundPosition returns -1
Replies: 8
Views: 1142

Re: GetSoundPosition returns -1

iMac bigsur Posted On bugs Mac OS Works if using the multichannel flag even if using play loop as well Channel = PlaySound(CurrentSound,#PB_Sound_MultiChannel|#PB_Sound_Loop ,100) Debug GetSoundPosition(CurrentSound,#PB_Sound_Millisecond,Channel) Does not work if #PB_Sound_MultiChannel is not used.
by collectordave
Thu Sep 01, 2022 2:59 pm
Forum: Bugs - Mac OSX
Topic: [Done] GetSoundPosition returns -1
Replies: 8
Views: 1142

Re: GetSoundPosition returns -1

Tried many ogg files.

All the same.
by collectordave
Thu Sep 01, 2022 9:42 am
Forum: Bugs - Mac OSX
Topic: [Done] GetSoundPosition returns -1
Replies: 8
Views: 1142

[Done] GetSoundPosition returns -1

iMac bigsur GetSoundPosition always returns -1. InitSound() ; Initialize Sound system UseOGGSoundDecoder() Global Currentsound.i Currentsound = LoadSound(#PB_Any,GetUserDirectory(#PB_Directory_Documents) + "TI Media/10cc/10cc - Donna.ogg") Debug CurrentSound PlaySound(CurrentSound,#PB_Soun...
by collectordave
Tue Aug 23, 2022 8:30 am
Forum: Mac OSX
Topic: error: invalid preprocessing directive
Replies: 4
Views: 864

Re: error: invalid preprocessing directive

Yes read that and the M1 chip does report as a 64bit when you use. CompilerIf #PB_Compiler_Processor = #PB_Processor_Arm64 ; not #PB_Processor_x64 Debug "Arm 64" CompilerElse Debug "Not ARM64" CompilerEndIf This bit of code selects some assembler code but even selecting the corre...
by collectordave
Tue Aug 23, 2022 7:45 am
Forum: Mac OSX
Topic: error: invalid preprocessing directive
Replies: 4
Views: 864

Re: error: invalid preprocessing directive

Just trying a few more things and used this code Debug SizeOf(Integer) If #PB_Compiler_Processor = #PB_Processor_x64 Debug "X64" Else Debug "X32" EndIf This returns 8 for the integer size indicating a 64bit processor? but the compiler directive reports 32bit I am on an iMac 24 , ...