// File: /workspace/github_c_makefile_star2_O2/enzo1982[P]smooth/samples/beatclock/beat.cpp
// Function: BeatClock::BeatClock()
BeatClock::BeatClock() : Application("BeatClock")
{
	actbeats    = -1;
	actcbeats   = -1;
	actccbeats  = -1;
	timeformat  = 0;
	centi	    = True;
	isalarm	    = False;
	alarmexec   = False;
	alarmbeats  = 0;
	alarmsecs   = 0;
	alarmoption = 0;
	modechange  = 3;
	timezone    = 0;

	wmpaint	    = True;
	wpx	    = 16;
	wpy	    = 16;

	ReadConfig();

	wnd		= new GUI::Window("BeatClock", Point(wpx, wpy), Size(164, 103));
	title		= new Titlebar(TB_CLOSEBUTTON);
	menubar		= new Menubar();
	timer		= new Timer();
	dragcontrol	= new DragControl();

	timer->onInterval.Connect(&BeatClock::PaintTime, this);

	MenuEntry	*entry;

	menubar->AddEntry("Mode")->onAction.Connect(&BeatClock::Mode, this);
	menubar->AddEntry("Options")->onAction.Connect(&BeatClock::ShowOptionsDialog, this);
	menubar->AddEntry()->SetOrientation(OR_RIGHT);

	entry = menubar->AddEntry("Info");
	entry->onAction.Connect(&BeatClock::Info, this);
	entry->SetOrientation(OR_RIGHT);

	Add(wnd);

	wnd->Add(dragcontrol);
	wnd->Add(title);
	wnd->Add(menubar);

	wnd->SetIcon(ImageLoader::Load("beat.pci:0"));
	wnd->onPaint.Connect(&BeatClock::PaintAll, this);
	wnd->SetFlags(WF_TOPMOST | WF_NOTASKBUTTON | WF_NORESIZE);
	wnd->onChangePosition.Connect(&BeatClock::OnChangePosition, this);
	wnd->Show();

	timer->Start(50);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x394f(%rip), %rsi      # 0x907e
movq %rsp, %r14
movq %r14, %rdi
callq 0x5400
movq %rbx, %rdi
movq %r14, %rsi
callq 0x53e0
movq %rsp, %rdi
callq 0x54a0
leaq 0x703c(%rip), %rax      # 0xc790
movq %rax, (%rbx)
leaq 0x608(%rbx), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x5270
movaps 0x38a1(%rip), %xmm0     # 0x9010
movups %xmm0, 0x5e0(%rbx)
movw $0x1, 0x5f0(%rbx)
movb $0x0, 0x5f2(%rbx)
andl $0x0, 0x620(%rbx)
movaps 0x388c(%rip), %xmm0     # 0x9020
movups %xmm0, 0x5f4(%rbx)
movb $0x1, 0x624(%rbx)
movabsq $0x1000000010, %rax     # imm = 0x1000000010
movq %rax, 0x628(%rbx)
movl $0x6d8, %edi            # imm = 0x6D8
callq 0x52d0
movq %rax, %r12
leaq 0x38b7(%rip), %rsi      # 0x907e
movq %rsp, %rdi
callq 0x5400
movq 0x628(%rbx), %rax
leaq 0x18(%rsp), %rdx
movq %rax, (%rdx)
movabsq $0x67000000a4, %rax     # imm = 0x67000000A4
leaq 0x20(%rsp), %rcx
movq %rax, (%rcx)
movq %rsp, %rsi
movq %r12, %rdi
xorl %r8d, %r8d
callq 0x51a0
movq %r12, 0x5b8(%rbx)
movq %rsp, %rdi
callq 0x54a0
movl $0x5c8, %edi            # imm = 0x5C8
callq 0x52d0
movq %rax, %r12
pushq $0x4
popq %rsi
movq %rax, %rdi
callq 0x50f0
movq %r12, 0x5c0(%rbx)
movl $0x688, %edi            # imm = 0x688
callq 0x52d0
movq %rax, %r12
movq %rax, %rdi
callq 0x5180
movq %r12, 0x5c8(%rbx)
pushq $0x68
popq %rdi
callq 0x52d0
movq %rax, %r12
movq %rax, %rdi
callq 0x5310
movq %r12, 0x5d8(%rbx)
movl $0x5c8, %edi            # imm = 0x5C8
callq 0x52d0
movq %rax, %r12
movq %rax, %rdi
callq 0x52a0
movq %r12, 0x5d0(%rbx)
movq 0x5d8(%rbx), %rdi
addq $0x48, %rdi
leaq 0x2b4(%rip), %rsi       # 0x5b44
xorl %edx, %edx
movq %rbx, %rcx
callq 0x5ed8
movq 0x5c8(%rbx), %r15
leaq 0x37e0(%rip), %rsi      # 0x9088
movq %rsp, %rdi
callq 0x5400
movq %rsp, %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0x5f74
addq $0x478, %rax            # imm = 0x478
leaq 0x294(%rip), %rsi       # 0x5b5e
movq %rax, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x5ed8
movq %rsp, %rdi
callq 0x54a0
movq 0x5c8(%rbx), %r15
leaq 0x3929(%rip), %rsi      # 0x9216
movq %rsp, %rdi
callq 0x5400
movq %rsp, %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0x5f74
addq $0x478, %rax            # imm = 0x478
leaq 0x31d(%rip), %rsi       # 0x5c2c
movq %rax, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x5ed8
movq %rsp, %rdi
callq 0x54a0
movq 0x5c8(%rbx), %r15
movq %rsp, %rdi
xorl %esi, %esi
callq 0x5270
movq %rsp, %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0x5f74
movq (%rax), %rcx
pushq $0x20
popq %rsi
movq %rax, %rdi
callq *0x120(%rcx)
movq %rsp, %rdi
callq 0x54a0
movq 0x5c8(%rbx), %r15
leaq 0x3726(%rip), %rsi      # 0x908d
movq %rsp, %rdi
callq 0x5400
movq %rsp, %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0x5f74
movq %rax, %r15
movq %rsp, %rdi
callq 0x54a0
leaq 0x478(%r15), %rdi
leaq 0x33d(%rip), %rsi       # 0x5cd2
xorl %edx, %edx
movq %rbx, %rcx
callq 0x5ed8
movq (%r15), %rax
pushq $0x20
popq %rsi
movq %r15, %rdi
callq *0x120(%rax)
movq 0x5b8(%rbx), %rsi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x30(%rax)
movq 0x5b8(%rbx), %rdi
movq 0x5d0(%rbx), %rsi
movq (%rdi), %rax
callq *0x30(%rax)
movq 0x5b8(%rbx), %rdi
movq 0x5c0(%rbx), %rsi
movq (%rdi), %rax
callq *0x30(%rax)
movq 0x5b8(%rbx), %rdi
movq 0x5c8(%rbx), %rsi
movq (%rdi), %rax
callq *0x30(%rax)
movq 0x5b8(%rbx), %r15
leaq 0x368a(%rip), %rsi      # 0x9092
movq %rsp, %rdi
callq 0x5400
leaq 0x18(%rsp), %rdi
movq %rsp, %rsi
callq 0x5420
leaq 0x18(%rsp), %rsi
movq %r15, %rdi
callq 0x5250
leaq 0x18(%rsp), %rdi
callq 0x5130
movq %rsp, %rdi
callq 0x54a0
movl $0x648, %edi            # imm = 0x648
addq 0x5b8(%rbx), %rdi
leaq 0x2f7(%rip), %rsi       # 0x5d46
xorl %edx, %edx
movq %rbx, %rcx
callq 0x5ed8
movq 0x5b8(%rbx), %rdi
movl $0xe, 0x30(%rdi)
addq $0x278, %rdi            # imm = 0x278
leaq 0x3b9(%rip), %rsi       # 0x5e2e
xorl %edx, %edx
movq %rbx, %rcx
callq 0x5fea
movq 0x5b8(%rbx), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
movq 0x5d8(%rbx), %rdi
pushq $0x32
popq %rsi
callq 0x5030
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r15
leaq 0x18(%rsp), %rdi
callq 0x5130
jmp 0x5b1a
jmp 0x5b17
jmp 0x5b26
jmp 0x5b17
jmp 0x5b26
jmp 0x5b26
jmp 0x5b26
jmp 0x5b26
jmp 0x5ad8
movq %rax, %r15
pushq $0x68
popq %rsi
jmp 0x5af7
movq %rax, %r15
movl $0x688, %esi            # imm = 0x688
jmp 0x5af7
movq %rax, %r15
movl $0x5c8, %esi            # imm = 0x5C8
jmp 0x5af7
movq %rax, %r15
movq %rsp, %rdi
callq 0x54a0
jmp 0x5af2
movq %rax, %r15
movl $0x6d8, %esi            # imm = 0x6D8
movq %r12, %rdi
callq 0x5050
jmp 0x5b29
movq %rax, %r15
jmp 0x5b31
movq %rax, %r15
movq %rsp, %rdi
callq 0x54a0
jmp 0x5b39
jmp 0x5b17
jmp 0x5b17
movq %rax, %r15
movq %rsp, %rdi
callq 0x54a0
jmp 0x5b29
jmp 0x5b26
movq %rax, %r15
movq %r14, %rdi
callq 0x54a0
movq %rbx, %rdi
callq 0x5280
movq %r15, %rdi
callq 0x5190
nop