Skip to content

Commit

Permalink
Merge d9c22dd into 2513676
Browse files Browse the repository at this point in the history
  • Loading branch information
Jojo-Schmitz committed Dec 7, 2022
2 parents 2513676 + d9c22dd commit 366113d
Show file tree
Hide file tree
Showing 1,039 changed files with 689,373 additions and 486,164 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_lupdate.yml
Expand Up @@ -9,7 +9,7 @@ on:
publish:
description: 'Publish to Transifex: on - publish'
required: false
default: 'off'
default: 'on'
jobs:
lupdate:
runs-on: macos-10.15
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci_windows.yml
Expand Up @@ -102,6 +102,7 @@ jobs:
with:
name: MuseScore_x64_${{ github.run_id }}
path: build.artifacts\

build_x32:
runs-on: windows-2019
steps:
Expand All @@ -127,6 +128,7 @@ jobs:
if [[ "$BUILD_MODE" == "testing_build" || "$BUILD_MODE" == "stable_build" ]]; then
DO_BUILD='true'
fi
DO_BUILD='true'
echo "!! ATTENTION !! Windows x32 build run only for 'testing_build' and 'stable_build', and SKIP for 'pull requests' and nightly"
echo "DO_BUILD=$DO_BUILD" >> $GITHUB_ENV
echo "DO_BUILD: $DO_BUILD"
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -53,3 +53,7 @@ VERSION
SF_VERSION
/mscore/data/mscore.aps
/msvc.*

# Created during (master) build
thirdparty/lame/config.h
thirdparty/flac/flac-1.3.4/config.h
4 changes: 2 additions & 2 deletions CMakeLists.txt
Expand Up @@ -312,7 +312,7 @@ else (APPLE)
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/MT /W4 /Zi /O2 /Ob1 /DNDEBUG")
set(CMAKE_EXE_LINKER_FLAGS "/DYNAMICBASE:NO")
else (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -D_UNICODE -DUNICODE")
if (MINGW)
# -mno-ms-bitfields see #22048
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-ms-bitfields")
Expand Down Expand Up @@ -349,7 +349,7 @@ endif (MINGW OR MSVC OR APPLE)

# Download MuseScore SoundFont
if (DOWNLOAD_SOUNDFONT)
set (SF_VERSION_REMOTE_FILE ${PROJECT_BINARY_DIR}/VERSION)
set (SF_VERSION_REMOTE_FILE ${PROJECT_BINARY_DIR}/SF_VERSION)
set (SF_VERSION_LOCAL_FILE ${PROJECT_SOURCE_DIR}/share/sound/VERSION)
set (DOWNLOAD_URL_ROOT "https://ftp.osuosl.org/pub/musescore/soundfont/MuseScore_General")
set (SOUND_DIRECTORY ${PROJECT_SOURCE_DIR}/share/sound)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.GPL
@@ -1,5 +1,5 @@
MuseScore, free and open source music notation software
Copyright (C) 1999-2020 MuseScore BVBA and others
Copyright (C) 1999-2022 MuseScore BVBA and others

This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License version 2 as published
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.rtf
@@ -1,7 +1,7 @@
{\rtf1\ansi\ansicpg1252\deff0\nouicompat{\fonttbl{\f0\fnil\fcharset0 Courier New;}{\f1\fnil\fcharset77 Courier New;}}
{\*\generator Riched20 6.3.9600}\viewkind4\uc1
\pard\sa200\sl276\slmult1\f0\fs18\lang12 MuseScore, free and open source music notation software.\par
Copyright (C) 1999-2020 MuseScore BVBA and others.\par
Copyright (C) 1999-2022 MuseScore BVBA and others.\par
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation and reproduce below with the following exception:\par
- If you create a document which uses fonts included in MuseScore, and embed this font or unaltered portions of this font into the document, then this font does not by itself cause the resulting document to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the document might be covered by the GNU General Public License. If you modify this font, you may extend this exception to your version of the font, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.\par
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\par
Expand Down
6 changes: 0 additions & 6 deletions all.h
Expand Up @@ -224,12 +224,6 @@
#define Q_ASSERT(a)
#endif

#if (defined (_MSCVER) || defined (_MSC_VER))
// Undefined problematic #def'd macros in Microsoft headers
#undef STRING_NONE
#undef small
#endif

#endif // __cplusplus

#endif
Expand Down
1 change: 1 addition & 0 deletions audio/drivers/alsa.cpp
Expand Up @@ -616,6 +616,7 @@ AlsaAudio::~AlsaAudio()
{
stop();
delete alsa;
delete midiDriver;
}

//---------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion audio/drivers/alsamidi.h
Expand Up @@ -47,7 +47,7 @@ class AlsaMidiDriver : public MidiDriver {

public:
AlsaMidiDriver(Seq* s);
virtual ~AlsaMidiDriver() {}
~AlsaMidiDriver();
virtual bool init();
virtual Port registerOutPort(const QString& name);
virtual Port registerInPort(const QString& name);
Expand Down
8 changes: 7 additions & 1 deletion audio/drivers/mididriver.cpp
Expand Up @@ -112,10 +112,16 @@ static const unsigned int outCap = SND_SEQ_PORT_CAP_SUBS_WRITE;
//---------------------------------------------------------

AlsaMidiDriver::AlsaMidiDriver(Seq* s)
: MidiDriver(s)
: MidiDriver(s), alsaSeq(0)
{
}

AlsaMidiDriver::~AlsaMidiDriver()
{
if (alsaSeq)
snd_seq_close(alsaSeq);
}

//---------------------------------------------------------
// init
// return false on error
Expand Down
69 changes: 43 additions & 26 deletions audio/drivers/pm.cpp
Expand Up @@ -51,10 +51,18 @@ PortMidiDriver::PortMidiDriver(Seq* s)

PortMidiDriver::~PortMidiDriver()
{
if (timer) {
timer->stop();
delete timer;
}
if (inputStream) {
Pt_Stop();
Pm_Close(inputStream);
}
if (outputStream) {
Pt_Stop();
Pm_Close(outputStream);
}
}

//---------------------------------------------------------
Expand All @@ -64,41 +72,50 @@ PortMidiDriver::~PortMidiDriver()

bool PortMidiDriver::init()
{
inputId = getDeviceIn(preferences.getString(PREF_IO_PORTMIDI_INPUTDEVICE));
if (inputId == -1)
inputId = Pm_GetDefaultInputDeviceID();

if (inputId == pmNoDevice)
return false;

inputId = getDeviceIn(preferences.getString(PREF_IO_PORTMIDI_INPUTDEVICE)); // Note: allow init even if inputId == pmNoDevice, in case of output
outputId = getDeviceOut(preferences.getString(PREF_IO_PORTMIDI_OUTPUTDEVICE)); // Note: allow init even if outputId == pmNoDevice, since input is more important than output.

bool autoGrabbing = false;
if ((inputId == -1) && (preferences.getString(PREF_IO_PORTMIDI_INPUTDEVICE) != " ")) {
inputId = Pm_GetDefaultInputDeviceID();
autoGrabbing = true;
}
// do not automatically grab the same device as both input and output
if (autoGrabbing && (outputId != -1)) {
const PmDeviceInfo* info = Pm_GetDeviceInfo(inputId);
QString portmidiInputDevice;
if (info && (info->input))
portmidiInputDevice = QString(info->interf) + "," + QString(info->name);
if (portmidiInputDevice == preferences.getString(PREF_IO_PORTMIDI_OUTPUTDEVICE))
inputId = -1;
}
if ((inputId == pmNoDevice) && (outputId == pmNoDevice) && (preferences.getString(PREF_IO_PORTMIDI_INPUTDEVICE) != " "))
return false;
static const int DRIVER_INFO = 0;
static const int TIME_INFO = 0;

Pt_Start(20, 0, 0); // timer started, 20 millisecond accuracy

PmError error = Pm_OpenInput(&inputStream,
inputId,
(void*)DRIVER_INFO,
preferences.getInt(PREF_IO_PORTMIDI_INPUTBUFFERCOUNT),
((PmTimeProcPtr) Pt_Time),
(void*)TIME_INFO);
if (error != pmNoError) {
const char* p = Pm_GetErrorText(error);
qDebug("PortMidi: open input (id=%d) failed: %s", int(inputId), p);
Pt_Stop();
return false;
if (inputId != pmNoDevice) {
PmError error = Pm_OpenInput(&inputStream,
inputId,
(void*)DRIVER_INFO,
preferences.getInt(PREF_IO_PORTMIDI_INPUTBUFFERCOUNT),
((PmTimeProcPtr) Pt_Time),
(void*)TIME_INFO);
if (error != pmNoError) {
const char* p = Pm_GetErrorText(error);
qDebug("PortMidi: open input (id=%d) failed: %s", int(inputId), p);
Pt_Stop();
return false;
}
Pm_SetFilter(inputStream, PM_FILT_ACTIVE | PM_FILT_CLOCK | PM_FILT_SYSEX);
PmEvent buffer[1];
while (Pm_Poll(inputStream))
Pm_Read(inputStream, buffer, 1);
}

Pm_SetFilter(inputStream, PM_FILT_ACTIVE | PM_FILT_CLOCK | PM_FILT_SYSEX);

PmEvent buffer[1];
while (Pm_Poll(inputStream))
Pm_Read(inputStream, buffer, 1);

if (outputId != pmNoDevice) {
error = Pm_OpenOutput(&outputStream,
PmError error = Pm_OpenOutput(&outputStream,
outputId,
(void*)DRIVER_INFO,
preferences.getInt(PREF_IO_PORTMIDI_OUTPUTBUFFERCOUNT),
Expand Down
1 change: 1 addition & 0 deletions audio/drivers/pm.h
Expand Up @@ -62,6 +62,7 @@ class PortMidiDriver : public MidiDriver {
PmStream* getOutputStream() { return outputStream; }
bool canOutput() { return outputStream != 0; }
bool isSameCoreMidiIacBus(const QString& inInterfaceAndName, const QString& outInterfaceAndName);
int getInputId() { return inputId; }
};


Expand Down
22 changes: 12 additions & 10 deletions audio/exports/exportmidi.cpp
Expand Up @@ -33,11 +33,10 @@ namespace Ms {
// writeHeader
//---------------------------------------------------------

void ExportMidi::writeHeader()
void ExportMidi::writeHeader(MidiTrack& tempoTrack)
{
if (mf.tracks().isEmpty())
return;
MidiTrack &track = mf.tracks().front();
#if 0 // TODO
MeasureBase* measure = cs->first();

Expand Down Expand Up @@ -86,7 +85,7 @@ void ExportMidi::writeHeader()
//--------------------------------------------

int staffIdx = 0;
for (auto& track1: mf.tracks()) {
for (auto& track: mf.tracks()) {
Staff* staff = cs->staff(staffIdx);

QByteArray partName = staff->partName().toUtf8();
Expand All @@ -101,7 +100,7 @@ void ExportMidi::writeHeader()
ev.setEData(data);
ev.setLen(len);

track1.insert(0, ev);
track.insert(0, ev);


++staffIdx;
Expand Down Expand Up @@ -149,7 +148,7 @@ void ExportMidi::writeHeader()
ev.setMetaType(META_TIME_SIGNATURE);
ev.setEData(data);
ev.setLen(4);
track.insert(pauseMap.addPauseTicks(is->first + tickOffset), ev);
tempoTrack.insert(pauseMap.addPauseTicks(is->first + tickOffset), ev);
}
}

Expand All @@ -159,7 +158,7 @@ void ExportMidi::writeHeader()
//---------------------------------------------------

staffIdx = 0;
for (auto& track1: mf.tracks()) {
for (auto& track: mf.tracks()) {
Staff* staff = cs->staff(staffIdx);
KeyList* keys = staff->keyList();

Expand All @@ -183,7 +182,7 @@ void ExportMidi::writeHeader()
data[1] = 0; // major
ev.setEData(data);
int tick = ik->first + tickOffset;
track1.insert(pauseMap.addPauseTicks(tick), ev);
track.insert(pauseMap.addPauseTicks(tick), ev);
if (tick == 0)
initialKeySigFound = true;
}
Expand All @@ -200,7 +199,7 @@ void ExportMidi::writeHeader()
data[0] = key;
data[1] = 0; // major
ev.setEData(data);
track1.insert(0, ev);
track.insert(0, ev);
}

++staffIdx;
Expand Down Expand Up @@ -228,7 +227,7 @@ void ExportMidi::writeHeader()
data[1] = tempo >> 8;
data[2] = tempo;
ev.setEData(data);
track.insert(it->first, ev);
tempoTrack.insert(it->first, ev);
}
}

Expand All @@ -249,6 +248,8 @@ bool ExportMidi::write(QIODevice* device, bool midiExpandRepeats, bool exportRPN
mf.setDivision(MScore::division);
mf.setFormat(1);
QList<MidiTrack>& tracks = mf.tracks();
MidiTrack tempoTrack;
tempoTrack.setOutChannel(0);

for (int i = 0; i < cs->nstaves(); ++i)
tracks.append(MidiTrack());
Expand All @@ -257,7 +258,7 @@ bool ExportMidi::write(QIODevice* device, bool midiExpandRepeats, bool exportRPN
cs->renderMidi(&events, false, midiExpandRepeats, synthState);

pauseMap.calculate(cs);
writeHeader();
writeHeader(tempoTrack);

int staffIdx = 0;
for (auto &track: tracks) {
Expand Down Expand Up @@ -370,6 +371,7 @@ bool ExportMidi::write(QIODevice* device, bool midiExpandRepeats, bool exportRPN
}
++staffIdx;
}
tracks.prepend(tempoTrack);
return !mf.write(device);
}

Expand Down
2 changes: 1 addition & 1 deletion audio/exports/exportmidi.h
Expand Up @@ -47,7 +47,7 @@ class ExportMidi {

PauseMap pauseMap;

void writeHeader();
void writeHeader(MidiTrack& tempoTrack);

public:
MidiFile mf;
Expand Down

0 comments on commit 366113d

Please sign in to comment.