Einzelnen Beitrag anzeigen

EWeiss
(Gast)

n/a Beiträge
 
#12

AW: Seltsames verhalten mit Units DC

  Alt 26. Aug 2018, 00:13
Und dein Mixer-Projekt hat keine Projekt-Datei (*.dpr/*.dproj)?

Ich sehe dort auch kein implementation oder ein end. in deinem Code-Schnipsel, somit ist das weit entfernt von komplett.

Also bitte ein komplettes Beispiel (wohl am besten in einer zip-Datei).
Ach lass mal.. Ich sehe hier und weis was los ist von daher ist das Thema für mich erledigt.
Mein bestreben war nur das verhalten mitzuteilen ich muss hier nichts beweisen.
Wie ich schon sagte mir ist es egal.

Aber hier dein implementation und end Beispiel.

Delphi-Quellcode:
{ ' UNIT uMain.pas
  '--------------------------- uMain -----------------------------
  ' Sample for SKAero API Module.. Main Application
  ' Copyright © 2018 BrewIdeas@Emil Weiss, All Rights Reserved
  '
  ' Author(s) of this Unit: Emil Weiss
  '
  '---------------------------------------------------------------------------- }


unit uMain;

interface

{$R '_resources\Mixer.res' '_resources\Mixer.rc'}

{$IFDEF WIN64}
  {$R '_resources\Manifest64.res'}
{$ELSE}
  {$R '_resources\Manifest.res'}
{$ENDIF}

{$REGION 'Uses'}

uses Classes, Windows, Messages, ShellApi, CommCtrl, StrUtils, ShlObj, SysUtils, SKAeroAPI, ActiveX,
  uGlobal, Graphics, uControls, uIni, Dialogs, mmsystem, AudioVolume, StdCtrls, MMDevice, Math,
  SimpleAudioVolume, AudioSessionControl, AudioSessionControl2, ProcessList;
{$ENDREGION}
{$REGION 'Functions / Procedures'}
function WinMain(hInstance: HINST; hPrevInstance: HINST; lpCmdLine: PChar; nCmdShow: integer)
  : LRESULT; stdcall;
procedure DetectBackground;
function WndProc(WinHandle: HWND; Msg: UINT; wP: WParam; lP: LParam): LRESULT; stdcall;
procedure PlaySoundSlide;
procedure PlaySoundPush;
procedure PlaySoundBlup;
// AudioVolume
{$ENDREGION}
// TMainClass
{$REGION 'TMainClass'}

type
  TMainClass = class
    procedure MasterDefaultDeviceChange(NewDefaultDevice: TDeviceInfo);
    procedure MasterDeviceStateChange(DeviceId: string; NewDeviceState: Cardinal);
    procedure MasterVolumeEvent(Volume: Single; Mute: Boolean);
    procedure AudioVolumeInitialize;
    function CreateHBitmapFromImg(Img: LONG_PTR; var imgW, imgH: integer): HBitmap;
    procedure CreateMasterIcon(x, y: integer; IconHandle: UINT = 0);
    procedure CreateSessionIcon(Index: integer; x, y: integer; IconHandle: UINT = 0);
    function CreateImgFromIcon(wsFile: WideString; IconHandle: UINT = 0): LONG_PTR;
    procedure CreateSession;
    function GetHIconFromFile(AFileName: String; ASmall: Boolean = false; AIndex: integer = 0)
      : HICON;
    procedure SessionCreated(const NewSession: IAudioSessionControl);
    procedure SessionDisconnectedEvent(Sender: TCustomAudioVolume; DisconnectReason: UINT);
    procedure SessionStateEvent(Sender: TCustomAudioVolume; NewState: integer);
    procedure SessionVolumeEvent(Sender: TCustomAudioVolume; Volume: Single; Mute: Boolean);
    procedure PropertyIconChanged(IconPath: string);
    procedure ShowOutputAttribute;
    procedure RemovefromList(DeviceId: string);
  private
    OldMute: Boolean;
    { private-Deklarationen }
    OldSessionMute: Boolean;
    SimpleVolume: ISimpleAudioVolume;
    tmpAudioVolume: TAudioVolume;
  public
    { public-Deklarationen }
    DeviceName: string;
    Hint: WideString;
  end;
{$ENDREGION}
{$REGION 'Global Variable'}

var
  MainClass: TMainClass;
  // MyThread: TSessionThread;
  bMyVolSet: BOOL;
  bAttribute: BOOL;
  AudioVolume1: TAudioVolume;
  AudioVolumeArr: array of TAudioVolume;
  GotChannelCount: Boolean = false;
  ChannelCount: UINT;
  Peaks: array of Single;
  lRes: integer;
  Restart: BOOL;
  m_Initialize: BOOL;
  Second: DWORD;
{$ENDREGION}

implementation

// Animation
{$REGION 'RenderClock'}

procedure RenderClock;
var
  Tick: DWORD;
begin

  Tick := GetTickCount;
  if (Second = 0) then
    Second := Tick + 1000;

  if (Tick > Second) then
  begin
    Second := 0;
    gSprBackground.GD_SetObjectTextEx(ID_TIME_FRONT, PWideChar(TimeToStr(Now)), true);
  end;
end;
{$ENDREGION}
// Sound
{$REGION 'Sound'}
Ich schreibe bestimmt jetzt keine neue Anwendung extra für dich sorry..
Könnte das end. jetzt noch anhängen aber 45K hier rein zu klatschen wäre Schwachsinn.

gruss

Geändert von EWeiss (26. Aug 2018 um 00:17 Uhr)
  Mit Zitat antworten Zitat