Fixed karaoke mode committing
Other minor fixes/cleanup Originally committed to SVN as r753.
This commit is contained in:
parent
08ff09ee59
commit
c0b3721a7f
8 changed files with 37 additions and 21 deletions
|
@ -34,6 +34,7 @@ aegisub_SOURCES = \
|
||||||
audio_provider_lavc.cpp \
|
audio_provider_lavc.cpp \
|
||||||
audio_provider_ram.cpp \
|
audio_provider_ram.cpp \
|
||||||
audio_provider_stream.cpp \
|
audio_provider_stream.cpp \
|
||||||
|
audio_spectrum.cpp \
|
||||||
auto4_base.cpp \
|
auto4_base.cpp \
|
||||||
auto4_lua.cpp \
|
auto4_lua.cpp \
|
||||||
auto4_lua_assfile.cpp \
|
auto4_lua_assfile.cpp \
|
||||||
|
|
|
@ -1022,6 +1022,9 @@ void AudioDisplay::CommitChanges (bool nextLine) {
|
||||||
|
|
||||||
curDiag->Start.SetMS(curStartMS);
|
curDiag->Start.SetMS(curStartMS);
|
||||||
curDiag->End.SetMS(curEndMS);
|
curDiag->End.SetMS(curEndMS);
|
||||||
|
if (!karaoke->enabled)
|
||||||
|
// If user was editing karaoke stuff, that should take precedence of manual changes in the editbox,
|
||||||
|
// so only updated from editbox when not in kara mode
|
||||||
curDiag->Text = grid->editBox->TextEdit->GetText();
|
curDiag->Text = grid->editBox->TextEdit->GetText();
|
||||||
curDiag->UpdateData();
|
curDiag->UpdateData();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) 2005, Rodrigo Braz Monteiro, Niels Martin Hansen
|
// Copyright (c) 2005, 2006, 2007, Rodrigo Braz Monteiro, Niels Martin Hansen
|
||||||
// All rights reserved.
|
// All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -305,7 +305,7 @@ void AudioKaraoke::OnPaint(wxPaintEvent &event) {
|
||||||
dc.DrawRectangle(0,0,w,h);
|
dc.DrawRectangle(0,0,w,h);
|
||||||
|
|
||||||
// Set syllable font
|
// Set syllable font
|
||||||
wxFont curFont(9,wxFONTFAMILY_DEFAULT,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Verdana"),wxFONTENCODING_SYSTEM);
|
wxFont curFont(9,wxFONTFAMILY_DEFAULT,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Verdana"),wxFONTENCODING_SYSTEM); // FIXME, hardcoded font
|
||||||
dc.SetFont(curFont);
|
dc.SetFont(curFont);
|
||||||
|
|
||||||
// Draw syllables
|
// Draw syllables
|
||||||
|
@ -331,7 +331,8 @@ void AudioKaraoke::OnPaint(wxPaintEvent &event) {
|
||||||
dlen = tw + 8 + delta;
|
dlen = tw + 8 + delta;
|
||||||
|
|
||||||
// Draw border
|
// Draw border
|
||||||
dc.SetPen(wxPen(wxColour(0,0,0)));
|
//dc.SetPen(wxPen(wxColour(0,0,0)));
|
||||||
|
dc.SetPen(*wxTRANSPARENT_PEN);
|
||||||
if (syl.selected && !splitting) {
|
if (syl.selected && !splitting) {
|
||||||
dc.SetBrush(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT)));
|
dc.SetBrush(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT)));
|
||||||
dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT));
|
dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT));
|
||||||
|
@ -342,6 +343,15 @@ void AudioKaraoke::OnPaint(wxPaintEvent &event) {
|
||||||
}
|
}
|
||||||
dc.DrawRectangle(dx,0,dlen,h);
|
dc.DrawRectangle(dx,0,dlen,h);
|
||||||
|
|
||||||
|
// Put syllable-end-marker after text
|
||||||
|
dc.SetPen(*wxBLACK_PEN);
|
||||||
|
//dc.DrawLine(dx, 0, dx, h);
|
||||||
|
dc.DrawLine(dx, 0, dx+1, 0);
|
||||||
|
dc.DrawLine(dx, h-1, dx+1, h-1);
|
||||||
|
dc.DrawLine(dx+dlen-1, 0, dx+dlen-1, h);
|
||||||
|
dc.DrawLine(dx+dlen-2, 0, dx+dlen-1, 0);
|
||||||
|
dc.DrawLine(dx+dlen-2, h-1, dx+dlen-1, h-1);
|
||||||
|
|
||||||
// Draw text
|
// Draw text
|
||||||
if (splitting) {
|
if (splitting) {
|
||||||
// Make sure the text position is more predictable in case of splitting
|
// Make sure the text position is more predictable in case of splitting
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <wchar.h>
|
#include <tchar.h>
|
||||||
#else
|
#else
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
#include FT_FREETYPE_H
|
#include FT_FREETYPE_H
|
||||||
|
@ -73,7 +73,7 @@ namespace Automation4 {
|
||||||
fontsize = -MulDiv((int)(fontsize+0.5), GetDeviceCaps(dczero, LOGPIXELSY), 72);
|
fontsize = -MulDiv((int)(fontsize+0.5), GetDeviceCaps(dczero, LOGPIXELSY), 72);
|
||||||
ReleaseDC(0, dczero);
|
ReleaseDC(0, dczero);
|
||||||
|
|
||||||
LOGFONT lf;
|
LOGFONTW lf;
|
||||||
ZeroMemory(&lf, sizeof(lf));
|
ZeroMemory(&lf, sizeof(lf));
|
||||||
lf.lfHeight = fontsize;
|
lf.lfHeight = fontsize;
|
||||||
lf.lfWeight = style->bold ? FW_BOLD : FW_NORMAL;
|
lf.lfWeight = style->bold ? FW_BOLD : FW_NORMAL;
|
||||||
|
@ -85,7 +85,7 @@ namespace Automation4 {
|
||||||
lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
|
lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
|
||||||
lf.lfQuality = ANTIALIASED_QUALITY;
|
lf.lfQuality = ANTIALIASED_QUALITY;
|
||||||
lf.lfPitchAndFamily = DEFAULT_PITCH|FF_DONTCARE;
|
lf.lfPitchAndFamily = DEFAULT_PITCH|FF_DONTCARE;
|
||||||
wcsncpy(lf.lfFaceName, style->font.wc_str(), 32);
|
_tcsncpy(lf.lfFaceName, style->font.c_str(), 32);
|
||||||
|
|
||||||
HFONT thefont = CreateFontIndirect(&lf);
|
HFONT thefont = CreateFontIndirect(&lf);
|
||||||
if (!thefont) return false;
|
if (!thefont) return false;
|
||||||
|
@ -93,7 +93,7 @@ namespace Automation4 {
|
||||||
|
|
||||||
SIZE sz;
|
SIZE sz;
|
||||||
size_t thetextlen = text.length();
|
size_t thetextlen = text.length();
|
||||||
const wchar_t *thetext = text.wc_str();
|
const TCHAR *thetext = text.wc_str();
|
||||||
if (style->spacing) {
|
if (style->spacing) {
|
||||||
width = 0;
|
width = 0;
|
||||||
for (unsigned int i = 0; i < thetextlen; i++) {
|
for (unsigned int i = 0; i < thetextlen; i++) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) 2006, Niels Martin Hansen
|
// Copyright (c) 2006, 2007, Niels Martin Hansen
|
||||||
// All rights reserved.
|
// All rights reserved.
|
||||||
//
|
//
|
||||||
// Redistribution and use in source and binary forms, with or without
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -592,6 +592,7 @@ DialogOptions::DialogOptions(wxWindow *parent)
|
||||||
mainSizer->Add(buttonSizer,0,wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM,5);
|
mainSizer->Add(buttonSizer,0,wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM,5);
|
||||||
mainSizer->SetSizeHints(this);
|
mainSizer->SetSizeHints(this);
|
||||||
SetSizer(mainSizer);
|
SetSizer(mainSizer);
|
||||||
|
CenterOnParent();
|
||||||
|
|
||||||
// Read
|
// Read
|
||||||
ReadFromOptions();
|
ReadFromOptions();
|
||||||
|
|
|
@ -84,6 +84,7 @@ DialogVersionCheck::DialogVersionCheck(wxWindow *parent,bool hidden)
|
||||||
visible = false;
|
visible = false;
|
||||||
if (!hidden) {
|
if (!hidden) {
|
||||||
Show();
|
Show();
|
||||||
|
CenterOnParent();
|
||||||
visible = true;
|
visible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue