Autor Beitrag
Spatz
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57

WIN 2k
D7E
BeitragVerfasst: So 02.01.05 15:01 
Wie kann ich bei einem Surroundsystem Lautstärken für die einzelnen Boxen setzen? (Kann ich bei meinem Mixer)

Besten Dank
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: So 02.01.05 15:12 
da wirst du dir vermutlich schwertun. Entweder forderst du beim Hersteller deines Surroundsystems eine Doku an wie du die DLL's richtig ansprichst (falls es welche gibt).

Ansonsten wirst du fast selber die Position der Lautstärkeregelungen im Speicher des Treibers rausfinden müssen und diese dann von deinem Programm überschreiben...siehe hierzu www.delphi-forum.de/....php?p=203046#203046
Spatz Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57

WIN 2k
D7E
BeitragVerfasst: Di 04.01.05 18:11 
und wie bekomme ich die speicherposition am besten raus? denn ich habe für die lautstärkenreglung keinerlei zahlen nach denen ich mich richten könnte (nur ein schieber).
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Di 04.01.05 21:45 
wenn die lautstärke voll aufgedreht ist, beträgt ihr wert 255, und ganz unten null
ein paar mal ganz rauf / ganz runter sollten genügen das ausfindig zu machen.
Spatz Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57

WIN 2k
D7E
BeitragVerfasst: Do 06.01.05 17:24 
hmm... ich bekomme nie wirklich zu einer richtigen speicherstelle... wenn ich es ein, zwei mal ausprobiere, kommt jedes mal eine andere oder keine als resultat. an was kann das liegen? was muss ich eigentlich bei der option type (1 Byte, 2 Bytes, 4 Bytes, 8 Bytes, Float, Double) eingeben?
Ist diese Speicheradresse überhaupt konstant? (auch nach einem systemneustart?)
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Do 06.01.05 17:32 
rein theoretisch sollte der wert 1 byte lang sein, da er ja nur die werte 0-255 annehmen kann. wenn du damit aber nichts findest, probiere lieber mal andere typen aus. Float-typen sind es eher nicht...
Ob sich der Speicherbereich ändert, kann ich dir nicht auswendig sagen, am besten probierst du es mal aus.
Spatz Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57

WIN 2k
D7E
BeitragVerfasst: Do 06.01.05 17:59 
ich kann den wert nicht finden :(
ich habe es jetzt auch mal probiert, in dem ich nur schaute, ob sich der wert veränderte (mit increase, und decrease), trotzdem erfolglos...
Spatz Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57

WIN 2k
D7E
BeitragVerfasst: Fr 07.01.05 00:50 
so, hab es geschafft :lol:
alles über die winapi...

hab mittlerweile auch rausgefunden, wieso dies mit dem memory nicht funktionierte: es ist ein wert zwischen 0 und 65534...

hier noch mein code (für mixer v.1.5.8.0 von cmedia, deutsche sprache)
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:
56:
57:
58:
procedure TMain.changeClick(Sender: TObject);
const
  BTN_NAME:      PChar   = 'button';
  TAB_X:         integer = 330;
  TAB_Y:         integer = 233;
var
  h:   hWnd;
  tmp: hWnd;
  x:   integer;
begin
  h := GetWindow(FindWindow(nil, 'mixer'), GW_CHILD);
  if h <> 0 then
  begin
    tmp := 0;
    for x := 0 to 2 do
      tmp := FindWindowEx(h, tmp, BTN_NAME, nil); //sucht das handle des 3. Buttons
    h := tmp; // Handle des ErweiterteOptionen-Buttons
    PostMessage(h, BM_CLICK, 0, 0); //Öffnet Erweiterte Optionen

    while (FindWindow(nil, 'Erweiterte Optionen') = 0) do
    begin
      Application.ProcessMessages;
      Sleep(100);
    end;

    h := FindWindow(nil, 'Erweiterte Optionen');
    h := FindWindowEx(h, 0, 'SysTabControl32', nil);  //Klickt Lautstärke an 
    SendMessage(h, TCM_SETCURFOCUS, 2, 0);
    h := FindWindow(nil, 'Erweiterte Optionen');

    while FindWindowEx(h, 0, nil, 'Lautstärke') = 0 do
    begin
      Application.ProcessMessages;
      Sleep(100);
    end;

    h := FindWindowEx(h, 0, nil, 'Lautstärke');
    tmp := FindWindowEx(h, 0, 'msctls_trackbar32', nil);
    SendMessage(tmp, TBM_SETPOS, 0, vl.Position * 10);
    tmp := FindWindowEx(h, tmp, 'msctls_trackbar32', nil);
    SendMessage(tmp, TBM_SETPOS, 0, vr.Position * 10);
    tmp := FindWindowEx(h, tmp, 'msctls_trackbar32', nil);
    SendMessage(tmp, TBM_SETPOS, 0, c.Position * 10);    //Setzt die Lautstärken
    tmp := FindWindowEx(h, tmp, 'msctls_trackbar32', nil);
    SendMessage(tmp, TBM_SETPOS, 0, sub.Position * 10);
    tmp := FindWindowEx(h, tmp, 'msctls_trackbar32', nil);
    SendMessage(tmp, TBM_SETPOS, 0, hl.Position * 10);
    tmp := FindWindowEx(h, tmp, 'msctls_trackbar32', nil);
    SendMessage(tmp, TBM_SETPOS, 0, hr.Position * 10);
    Sleep(200);

    h := FindWindow(nil, 'Erweiterte Optionen');
    h := FindWindowEx(h, 0, BTN_NAME, 'OK');
    PostMessage(h, BM_CLICK, 0, 0); //Speichert die Änderungen
    h := GetWindow(FindWindow(nil, 'mixer'), GW_CHILD);
    SendMessage(h, WS_MINIMIZE, 0, 0);
  end else MessageDlg('Der Mixer ist nicht gestartet!', mtWarning, [mbOK], 0);
end;
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Sa 08.01.05 01:15 
Gratuliere, schöne Lösung :-)

hmm der standard treiber von Windows hat bei der Lautstärkeregelung die Werte 0-255, drum bin ich davon ausgegangen dass es bei deinem mixer gleich ist, tjo hat ja trotzdem funktioniert ;)