Autor Beitrag
Philipp_Reitter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 430



BeitragVerfasst: Fr 31.08.07 13:10 
hi

ich will so was wie im WinMediaplayer ... also mit so balken... adss die so schön herumspringen ^^
ich hab aber bisher nichts in der form gefeunden ...
kann mir jemand sagen wie ich das machen soll?

Mfg
Philipp
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Fr 31.08.07 13:22 
Wenn du die bass.dll benutzt, wie es der Titel suggeriert: Schau dir die Beispiele an, da gibts ein schönes Demo-Programm inkl. Source dazu. ;-)

_________________
We are, we were and will not be.
Philipp_Reitter Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 430



BeitragVerfasst: Fr 31.08.07 13:32 
ich find bei den demos nix dazu...
ich hab mir schon geamcht dass ich mal da eine demo dazu gesehen hab aber ich finds nicht mehr?!
ich hab jetzt bass 2.3
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Fr 31.08.07 13:41 
bass23.zip\delphi\SampleVis

_________________
We are, we were and will not be.
Philipp_Reitter Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 430



BeitragVerfasst: Fr 31.08.07 14:10 
thx
Timosch
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1314

Debian Squeeze, Win 7 Prof.
D7 Pers
BeitragVerfasst: Fr 31.08.07 14:43 
Ach ja, es heißt Oszilloskop...

_________________
If liberty means anything at all, it means the right to tell people what they do not want to hear. - George Orwell
Philipp_Reitter Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 430



BeitragVerfasst: Fr 31.08.07 20:27 
ich hab das jetzt so gelöst:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TfrmMain.Timer2Timer(Sender: TObject);
var FFTFata : TFFTData;
begin
  BASS_ChannelGetData(form1.chan, @FFTFata, BASS_DATA_FFT1024);
  Spectrum.Draw(Paint.Canvas.Handle,FFTFata,0,0);
end;


dann zum erstellen des spektrums:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
  Spectrum := TSpectrum.Create(frmmain.Paint.Width, frmmain.Panel1.Height);
  Spectrum.BackColor := clBlack;
  Spectrum.Pen       := clYellow;
  Spectrum.Peak      := clWhite;
  Spectrum.Mode      := 1;


und so ruf ich meinen stream auf:

ausblenden volle Höhe Delphi-Quelltext
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:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
function OpenURL(url: PChar): Integer;
var
  icy: PChar;
  Len, Progress: DWORD;
begin
  with form1 do begin
  Result := 0;
  BASS_StreamFree(chan); // close old stream
  progress := 0;
  SendMessage(win, WM_INFO_UPDATE, 0, 0); // reset the Labels and trying connecting

  chan := BASS_StreamCreateURL(url, 0, BASS_STREAM_STATUS, @StatusProc, 0);
  if (chan = 0) then
  begin
    SendMessage(win, WM_INFO_UPDATE, 1, 0); // Oops Error
  end
  else
  begin
    // Progress
    repeat
      len := BASS_StreamGetFilePosition(chan, BASS_FILEPOS_END);
      if (len = DW_Error) then
        break; // something's gone wrong! (eg. BASS_Free called)
      progress := (BASS_StreamGetFilePosition(chan, BASS_FILEPOS_DOWNLOAD) -
        BASS_StreamGetFilePosition(chan, BASS_FILEPOS_CURRENT)) * 100 div len;
      // percentage of buffer filled
      SendMessage(win, WM_INFO_UPDATE, 2, progress); // show the Progess value in the label

    until
      progress > 75;

    // get the broadcast name and bitrate
    icy := BASS_ChannelGetTags(chan, BASS_TAG_ICY);
    if (icy = nil) then
      icy := BASS_ChannelGetTags(chan, BASS_TAG_HTTP); // no ICY tags, try HTTP
    if (icy <> nil) then
      while (icy^ <> #0) do
      begin
        if (Copy(icy, 1, 9) = 'icy-name:') then
          SendMessage(win, WM_INFO_UPDATE, 3, DWORD(PChar(Copy(icy, 10, MaxInt))))

        else if (Copy(icy, 1, 7) = 'icy-br:') then

          SendMessage(win, WM_INFO_UPDATE, 4, DWORD(PChar('bitrate: ' + Copy(icy, 8, MaxInt))));
        icy := icy + Length(icy) + 1;
      end;
    // get the stream title and set sync for subsequent titles
    DoMeta(BASS_ChannelGetTags(chan, BASS_TAG_META));
    BASS_ChannelSetSync(chan, BASS_SYNC_META, 0, @MetaSync, 0);
    // play it!
    BASS_ChannelPlay(chan, FALSE);
  end;
  cthread := 0;
end;
end;


hab ich größten teils von dem Bass beispielen übernommen....

nur bekomm ich jetzt wenn der timer sich das erstemal ausführt eine ungültige gleitkomma operation...?!

kann mir jemand sagen woher das kommt?

Mfg
Philipp
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Fr 31.08.07 20:36 
Check mal, ob len bei der einen Division, die du da hast, Null ist. Wenn ja, darfst du die Division nicht durchführen.

_________________
We are, we were and will not be.
Philipp_Reitter Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 430



BeitragVerfasst: Fr 31.08.07 20:40 
ok hab den fehler weil er hat ne zeit zum verbinden gebraucht....

aber jetzt seh ich nur schwarz und keine streifen...?!
kommt das von der position?!
ich habs auf 0,0