Search found 1726 matches

by rlebeau
Thu Oct 22, 2020 10:39 am
Forum: Technical
Topic: Duplicates not allowed
Replies: 9
Views: 1229

Re: Duplicates not allowed

What do you think if I remove TThread.ForceQueue from DoMeta() and put in MetaSync? That would cause the entire DoMeta() to execute at some indeterminate future time after MetaSync() has exited. I would suggest calling BASS_ChannelGetTags() directly in the context of MetaSync() so it gets called as...
by rlebeau
Thu Oct 22, 2020 10:33 am
Forum: Technical
Topic: [Android]BASS
Replies: 31
Views: 6477

Re: [Android]BASS

// can't ref .O on earlier phones, must hardcode if TJBuild_VERSION.JavaClass.SDK_INT > 26 then // JBuild_VERSION_CODES.JavaClass.O begin {$ifdef VER330} Since that 'begin' follows a comment, it should be on the next line: // can't ref .O on earlier phones, must hardcode if TJBuild_VERSION.JavaClas...
by rlebeau
Wed Oct 21, 2020 11:22 am
Forum: Technical
Topic: Duplicates not allowed
Replies: 9
Views: 1229

Re: Duplicates not allowed

p := Pos('StreamTitle=', meta); [DCC Warning] UnitMain.pas(96): W1057 Implicit string cast from 'AnsiChar' to 'string' raw := Copy(meta, Pos('=', meta)+2, Pos(';',meta)-Pos('=', meta)-3); [DCC Warning] UnitMain.pas(113): W1057 Implicit string cast from 'AnsiChar' to 'string' <--- Four times + [DCC ...
by rlebeau
Mon Oct 19, 2020 10:37 am
Forum: Technical
Topic: Duplicates not allowed
Replies: 9
Views: 1229

Re: Duplicates not allowed

BASS_ChannelGetTags() returns 8bit data. You need to convert that to Unicode before you process it. See my reply to your other post on that issue.
by rlebeau
Mon Oct 19, 2020 10:12 am
Forum: Technical
Topic: Implicit string cast from 'AnsiChar' to 'string'
Replies: 3
Views: 622

Re: Implicit string cast from 'AnsiChar' to 'string'

BASS_ChannelGetTags() returns a null-terminated "const char*" pointer to 8bit character data, which would be PAnsiChar in Delphi (though you are using MarshaledAString for that on Android). You are implicitly converting that pointer as-is to UnicodeString when passing it to System.Pos(), System.Copy...
by rlebeau
Fri Oct 09, 2020 7:18 pm
Forum: Technical
Topic: [Android]BASS
Replies: 31
Views: 6477

Re: [Android]BASS

Lena wrote: Fri Oct 09, 2020 4:22 am I don't know why the service stops.
Android service doesn't work when I close app
by rlebeau
Tue Oct 06, 2020 10:43 am
Forum: Technical
Topic: [Android]BASS
Replies: 31
Views: 6477

Re: [Android]BASS

Are my first steps in creating a service correct? Again, I direct you to the Android documentation, which discusses this in detail: Media app architecture overview Audio app overview The key is to write a service that implements MediaBrowserService and contains a MediaSession, and write a UI app th...
by rlebeau
Mon Oct 05, 2020 1:49 pm
Forum: Technical
Topic: [Android]BASS
Replies: 31
Views: 6477

Re: [Android]BASS

Is it my steps correctly? I am not an Android developer, so this is WAY outside my area of expertise. 2. And in the application, send broadcast messages about the start or stop of playback. Unless you want other apps to control your service, using broadcast messages is not the best way to communica...
by rlebeau
Mon Oct 05, 2020 10:12 am
Forum: Technical
Topic: [Android]BASS
Replies: 31
Views: 6477

Re: [Android]BASS

If I minimize my application and lock the screen on the phone, then after a couple of minutes the player stops playing. Android is likely killing your app process when it goes into the background and stays there for a period of time. Understand the Activity Lifecycle How do I make the player work i...
by rlebeau
Fri Oct 02, 2020 10:56 am
Forum: Technical
Topic: [Android]BASS
Replies: 31
Views: 6477

Re: [Android]BASS

This is stated as much in the BASS_SetVolume() documentation : This function affects the volume level of all applications using the same output device. If you wish to only affect the level of your application's sounds, the BASS_ATTRIB_VOL attribute and/or the BASS_CONFIG_GVOL_MUSIC / BASS_CONFIG_GVO...
by rlebeau
Tue Sep 29, 2020 3:44 pm
Forum: Technical
Topic: [Android]BASS
Replies: 31
Views: 6477

Re: [Android]BASS

str := BASS_StreamCreateURL(PChar('http://91.199.194.34:8000'), 0, BASS_UNICODE, nil, nil); ShowMessage(IntToStr(BASS_ErrorGetCode)); //ErrorCode=41 Error Code 41 is BASS_ERROR_FILEFORM ("The file's format is not recognised/supported"), which means the HTTP server did not send an audio file/stream....
by rlebeau
Tue Sep 29, 2020 9:32 am
Forum: Technical
Topic: [Android]BASS
Replies: 31
Views: 6477

Re: [Android]BASS

I don't use phone code but i have used BASS in the older C++ Builder. Maybe i can post you a snippet or 2 to point you in right direction. Just be aware that String is UnicodeString in C++Builder 2009+, so use the BASS_UNICODE flag when calling BASS_StreamCreateURL(), not on BASS_Init(): BOOL BassL...
by rlebeau
Wed Sep 09, 2020 8:58 am
Forum: Technical
Topic: How correct
Replies: 5
Views: 2169

Re: How correct

ingalime wrote:But not fully understood.
...
Which is more correct Synchronize or ForceQueue?
You are comparing apples and oranges. Neither one is "more correct" than the other. They are two different scenarios. One is threaded, the other is not. Use whichever one suits your needs.
by rlebeau
Tue Sep 08, 2020 4:46 pm
Forum: Technical
Topic: How correct
Replies: 5
Views: 2169

Re: How correct

I want the user not to be able to press the button twice, three times ... They won't be able to, once you have disabled it. Without this line of code Application->ProcessMessages, the button appears to be accessible. If it is just a matter of visual appearance, simply use the button's Update() (VCL...
by rlebeau
Fri Sep 04, 2020 12:23 pm
Forum: Technical
Topic: How correct
Replies: 5
Views: 2169

Re: How correct

Neither. It should be more like this instead: SpeedButton1->Enabled = false; try { Application->ProcessMessages(); //other code } __finally { SpeedButton1->Enabled = true; } On the other hand, why are you calling ProcessMessages() at all? That is generally a sign of bad code design. If you need to l...