Author Topic: BASS for WinCE  (Read 375068 times)

Ian @ un4seen

  • Administrator
  • Posts: 26178
Re: BASS for WinCE
« Reply #325 on: 25 Jun '21 - 14:56 »
The Windows CE version of the BASS 2.4.16 release is up now in the 1st post.

Ian @ un4seen

  • Administrator
  • Posts: 26178
Re: BASS for WinCE
« Reply #326 on: 15 Jul '21 - 13:10 »
The Windows CE version of the BASSOPUS 2.4.2 release is up in the 1st post.

Ian @ un4seen

  • Administrator
  • Posts: 26178
Re: BASS for WinCE
« Reply #327 on: 10 May '22 - 17:40 »
The Windows CE version of the BASSMIDI 2.4.14 release is up in the 1st post.

Serhii

  • Posts: 6
Re: BASS for WinCE
« Reply #328 on: 27 Oct '22 - 07:10 »
Good afternoon
I'm trying to compile under WinCe InetRadio, an error pops up: "bass.pas(732,1) Fatal: Syntax error, "identifier" expected but "FUNCTION" found". Error: function BASS_SetConfig(option, value: DWORD): BOOL; {$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF}; external bassdll;
Everything works under win32.

unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
  ExtCtrls, Buttons, Bass;

type

  { TForm1 }

  TForm1 = class(TForm)
    BitBtn1: TBitBtn;
    BitBtn10: TBitBtn;
    BitBtn11: TBitBtn;
    BitBtn12: TBitBtn;
    BitBtn13: TBitBtn;
    BitBtn14: TBitBtn;
    BitBtn15: TBitBtn;
    BitBtn16: TBitBtn;
    BitBtn17: TBitBtn;
    BitBtn18: TBitBtn;
    BitBtn19: TBitBtn;
    BitBtn2: TBitBtn;
    BitBtn20: TBitBtn;
    BitBtn21: TBitBtn;
    BitBtn22: TBitBtn;
    BitBtn23: TBitBtn;
    BitBtn24: TBitBtn;
    BitBtn3: TBitBtn;
    BitBtn4: TBitBtn;
    BitBtn5: TBitBtn;
    BitBtn6: TBitBtn;
    BitBtn7: TBitBtn;
    BitBtn8: TBitBtn;
    BitBtn9: TBitBtn;
    Button2: TButton;
    Button3: TButton;
    Fallout: TImage;
    Image2: TImage;
    Image3: TImage;
    Image4: TImage;
    Image5: TImage;
    Stop: TButton;
    procedure BitBtn10Click(Sender: TObject);
    procedure BitBtn11Click(Sender: TObject);
    procedure BitBtn12Click(Sender: TObject);
    procedure BitBtn13Click(Sender: TObject);
    procedure BitBtn14Click(Sender: TObject);
    procedure BitBtn15Click(Sender: TObject);
    procedure BitBtn16Click(Sender: TObject);
    procedure BitBtn17Click(Sender: TObject);
    procedure BitBtn18Click(Sender: TObject);
    procedure BitBtn19Click(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    procedure BitBtn20Click(Sender: TObject);
    procedure BitBtn21Click(Sender: TObject);
    procedure BitBtn22Click(Sender: TObject);
    procedure BitBtn23Click(Sender: TObject);
    procedure BitBtn24Click(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
    procedure BitBtn3Click(Sender: TObject);
    procedure BitBtn4Click(Sender: TObject);
    procedure BitBtn5Click(Sender: TObject);
    procedure BitBtn6Click(Sender: TObject);
    procedure BitBtn7Click(Sender: TObject);
    procedure BitBtn8Click(Sender: TObject);
    procedure BitBtn9Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure StopClick(Sender: TObject);

  end;

var
  Form1: TForm1;


implementation


 var
  url_radio: HSTREAM;

{$R *.lfm}

{ TForm1 }

procedure TForm1.FormCreate(Sender: TObject);
begin
  BASS_CONFIG_DEV_BUFFER();
  BASS_Init(-1,44100,0,Handle,nil);
  BASS_SetConfig(BASS_CONFIG_NET_PLAYLIST, 1);
  BASS_SetConfig(BASS_CONFIG_NET_PREBUF, 0);

end;



procedure TForm1.StopClick(Sender: TObject);
begin
  BASS_ChannelStop(url_radio);
  BASS_StreamFree(url_radio);
  url_radio:=0;
end;



procedure TForm1.BitBtn10Click(Sender: TObject);
var
    url1:string;
begin
  try
  url1:='http://listen.42fm.ru:8000/stealkill-128';
  BASS_StreamFree(url_radio);
  BASS_ChannelSetAttribute(url_radio, BASS_ATTRIB_VOL, 100);
  url_radio := BASS_StreamCreateURL(PChar(url1), 0, BASS_STREAM_BLOCK or BASS_STREAM_STATUS or BASS_STREAM_AUTOFREE, nil, nil);
  BASS_ChannelPlay(url_radio,False);

  except
    on e:Exception do
   end;

end;

Tell me what's the problem?

JKD

  • Posts: 2
Re: BASS for WinCE
« Reply #329 on: 11 Dec '23 - 04:41 »
Hello,
I'm testing the latest supported bass.dll in WinCe 6 (emulator) and Wince 7 (device) which use ARM32. In both enviroments I'm getting BASS_ERROR_NONET error (32) using BASS_StreamCreateURL while network is enabled. Other applications can establish communication without problem. I've tested netradio demo getting the same error.

What steps does bass.dll perform to get that error? If there's no more support for WinCE, could it be possible to get that library source code to adapt it to the peculiarities of this obsolete operating system?

Ian @ un4seen

  • Administrator
  • Posts: 26178
Re: BASS for WinCE
« Reply #330 on: 11 Dec '23 - 13:51 »
BASS uses WinInet for internet access and will fail with BASS_ERROR_NONET when that (wininet.dll) can't be loaded (or if InternetOpen fails), so perhaps it isn't included in your WinCE versions?

JKD

  • Posts: 2
Re: BASS for WinCE
« Reply #331 on: 11 Dec '23 - 14:37 »
Wininet.dll exists at windows folder both in emulator and device. I've made a simple application to test InternetOpenW:
Code: [Select]
DWORD accesstype = INTERNET_HANDLE_TYPE_INTERNET;
WCHAR *proxy = NULL;
WCHAR *useragent=L"Test";
HINTERNET hi = InternetOpenW(useragent, accesstype, proxy, 0, 0);

Debugging indicates that the variable hi contains a handle other than NULL so in my test, InternetOpenW works  ???

Ian @ un4seen

  • Administrator
  • Posts: 26178
Re: BASS for WinCE
« Reply #332 on: 11 Dec '23 - 15:09 »
That's strange then. With default settings, the InternetOpen call will look like this:

Code: [Select]
HINTERNET hi = InternetOpenW(L"BASS/2.4", INTERNET_OPEN_TYPE_PRECONFIG, 0, 0, 0);

Do you still get a non-0 return value when trying that yourself? The only other time a BASS_ERROR_NONET error may occur is if the file request fails and InternetGetConnectedState fails too, so you could also check that.

alex.s

  • Posts: 4
Re: BASS for WinCE
« Reply #333 on: 13 Nov '24 - 08:03 »
Hello everyone!
Can anybody please share the link to actual version of BASS.NET CE for .Net CompactFramework?
This link www.un4seen.com/filez/4/Bass24.Net_compact.zip on the first page is damaged...

Thanks!

P.S. Googling has no results...

Ian @ un4seen

  • Administrator
  • Posts: 26178
Re: BASS for WinCE
« Reply #334 on: 13 Nov '24 - 14:17 »
That was discontinued quite a while ago. I think the last release was 2.4.12, but the latest version we're able to find right now is 2.4.11.1 (perhaps a user will pop-up with 2.4.12). I've put that up at the link above. Of course, it's missing support for stuff that's been added to BASS/add-ons since then, but hopefully it'll still work for you.

alex.s

  • Posts: 4
Re: BASS for WinCE
« Reply #335 on: 13 Nov '24 - 16:27 »
That was discontinued quite a while ago. I think the last release was 2.4.12, but the latest version we're able to find right now is 2.4.11.1 (perhaps a user will pop-up with 2.4.12). I've put that up at the link above. Of course, it's missing support for stuff that's been added to BASS/add-ons since then, but hopefully it'll still work for you.
Thank you so much!
I try to develop small mp3 player for some old device under winCE 6.0 R3 with .net compact framework 3.5
The Windows CE version of the BASS.DLL 2.4.16
bass.dll and Bass.Net.compact.dll are located near .exe file
Reference to Bass.Net.compact.dll was specified in the project.

And... got a problem with code like this:
Code: [Select]
using Un4seen.Bass;
private void Form1_Load(object sender, EventArgs e)
{
    Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, this.Handle);
}
It's throws an exception TypeLoadException
not only Bass.BASS_Init() but any call to Bass.BASS_xxx  do the same...

But... this code works fine:
Code: [Select]
[DllImport("bass", CharSet = CharSet.Auto)]
private static extern bool BASS_Init(int device, int freq, int flags, IntPtr hwnd, IntPtr clsid);

private void Form1_Load(object sender, EventArgs e)
{
   BASS_Init(-1, 44100, 0, this.Handle, IntPtr.Zero);
}

What am I doing wrong?
Maybe it's incompartible versions? bass ce 2.4.16 and bass.net.compact 2.4.11.1 ?
« Last Edit: 14 Nov '24 - 03:06 by alex.s »

Ian @ un4seen

  • Administrator
  • Posts: 26178
Re: BASS for WinCE
« Reply #336 on: 13 Nov '24 - 17:23 »
It's throws an exception TypeLoadException

I think that means it's unable to find/load either BASS.NET.COMPACT.DLL or BASS.DLL. Have both been deployed to the same folder as your EXE on the device, ie. you can see them there?

alex.s

  • Posts: 4
Re: BASS for WinCE
« Reply #337 on: 14 Nov '24 - 02:25 »
Have both been deployed to the same folder as your EXE on the device, ie. you can see them there?

That's right. I see them both. Strictly speaking not on phisical device but on the emulator.
They are automatically deployed by VS to the BIN\Release folder because they are included in the project.

Background is:
First I used the [DIIImport] attribute and everything was fine until I called BASS_ChannelGetLength.
This resulted same problem as in https://www.un4seen.com/forum/?topic=9534.msg79692#msg79692
So i start looking solutions for compact framework.
« Last Edit: 14 Nov '24 - 02:57 by alex.s »

Ian @ un4seen

  • Administrator
  • Posts: 26178
Re: BASS for WinCE
« Reply #338 on: 14 Nov '24 - 16:50 »
If you are able to use BASS.DLL via DllImport then I guess that means it's the BASS.NET.COMPACT.DLL file that can't be found/loaded for some reason. As Bernd mentioned in that linked thread, the .Net compact framework apparently only supports 32-bit integer return values from native code, so BASS.DLL included special versions of some functions (including BASS_ChannelGetLength) for BASS.NET.COMPACT.DLL to use:

Code: [Select]
void WINAPI BASS_GetCPU_(float *result);
void WINAPI BASS_GetVolume_(float *result);
void WINAPI BASS_StreamGetFilePosition_(HSTREAM handle, DWORD mode, QWORD *result);
void WINAPI BASS_ChannelBytes2Seconds_(DWORD handle, QWORD pos, double *result);
void WINAPI BASS_ChannelSeconds2Bytes_(DWORD handle, double pos, QWORD *result);
void WINAPI BASS_ChannelGetLength_(DWORD handle, DWORD mode, QWORD *result);
void WINAPI BASS_ChannelGetPosition_(DWORD handle, DWORD mode, QWORD *result);

Perhaps you can use them directly via DllImport.

alex.s

  • Posts: 4
Re: BASS for WinCE
« Reply #339 on: 15 Nov '24 - 03:56 »
Perhaps you can use them directly via DllImport.

Oh, thanks!
If it works, it's more than enough for me.