rewrote FLP import filter, various coding style fixes (stable backport)

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/branches/lmms/stable-0.4@1842 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-11-21 23:22:36 +00:00
parent 1381709a58
commit 98371cb148
40 changed files with 2732 additions and 970 deletions

View File

@@ -2,4 +2,4 @@ INCLUDE(BuildPlugin)
INCLUDE_DIRECTORIES(unrtf)
BUILD_PLUGIN(flpimport flp_import.cpp flp_import.h)
BUILD_PLUGIN(flpimport flp_import.cpp unrtf.cpp flp_import.h)

File diff suppressed because it is too large Load Diff

View File

@@ -34,134 +34,9 @@
#include "note.h"
enum flpEvents
{
// BYTE EVENTS
FLP_Byte = 0,
FLP_Enabled = 0,
FLP_NoteOn = 1, //+pos (byte)
FLP_Vol = 2,
FLP_Pan = 3,
FLP_MIDIChan = 4,
FLP_MIDINote = 5,
FLP_MIDIPatch = 6,
FLP_MIDIBank = 7,
FLP_LoopActive = 9,
FLP_ShowInfo = 10,
FLP_Shuffle = 11,
FLP_MainVol = 12,
FLP_Stretch = 13, // old byte version
FLP_Pitchable = 14,
FLP_Zipped = 15,
FLP_Delay_Flags = 16,
FLP_PatLength = 17,
FLP_BlockLength = 18,
FLP_UseLoopPoints = 19,
FLP_LoopType = 20,
FLP_ChanType = 21,
FLP_MixSliceNum = 22,
// WORD EVENTS
FLP_Word = 64,
FLP_NewChan = FLP_Word,
FLP_NewPat = FLP_Word + 1, //+PatNum (word)
FLP_Tempo = FLP_Word + 2,
FLP_CurrentPatNum = FLP_Word + 3,
FLP_PatData = FLP_Word + 4,
FLP_FX = FLP_Word + 5,
FLP_Fade_Stereo = FLP_Word + 6,
FLP_CutOff = FLP_Word + 7,
FLP_DotVol = FLP_Word + 8,
FLP_DotPan = FLP_Word + 9,
FLP_PreAmp = FLP_Word + 10,
FLP_Decay = FLP_Word + 11,
FLP_Attack = FLP_Word + 12,
FLP_DotNote = FLP_Word + 13,
FLP_DotPitch = FLP_Word + 14,
FLP_DotMix = FLP_Word + 15,
FLP_MainPitch = FLP_Word + 16,
FLP_RandChan = FLP_Word + 17,
FLP_MixChan = FLP_Word + 18,
FLP_Resonance = FLP_Word + 19,
FLP_LoopBar = FLP_Word + 20,
FLP_StDel = FLP_Word + 21,
FLP_FX3 = FLP_Word + 22,
FLP_DotReso = FLP_Word + 23,
FLP_DotCutOff = FLP_Word + 24,
FLP_ShiftDelay = FLP_Word + 25,
FLP_LoopEndBar = FLP_Word + 26,
FLP_Dot = FLP_Word + 27,
FLP_DotShift = FLP_Word + 28,
// DWORD EVENTS
FLP_Int = 128,
FLP_Color = FLP_Int,
FLP_PlayListItem = FLP_Int + 1, //+Pos (word) +PatNum (word)
FLP_Echo = FLP_Int + 2,
FLP_FXSine = FLP_Int + 3,
FLP_CutCutBy = FLP_Int + 4,
FLP_WindowH = FLP_Int + 5,
FLP_MiddleNote = FLP_Int + 7,
FLP_Reserved = FLP_Int + 8, // may contain an invalid version info
FLP_MainResoCutOff = FLP_Int + 9,
FLP_DelayReso = FLP_Int + 10,
FLP_Reverb = FLP_Int + 11,
FLP_IntStretch = FLP_Int + 12,
FLP_SSNote = FLP_Int + 13,
FLP_FineTune = FLP_Int + 14,
// TEXT EVENTS
FLP_Undef = 192, //+Size (var length)
FLP_Text = FLP_Undef, //+Size (var length)+Text
// (Null Term. String)
FLP_Text_ChanName = FLP_Text, // name for the current channel
FLP_Text_PatName = FLP_Text + 1, // name for the current pattern
FLP_Text_Title = FLP_Text + 2, // title of the loop
FLP_Text_Comment = FLP_Text + 3, // old comments in text format.
// Not used anymore
FLP_Text_SampleFileName = FLP_Text + 4, // filename for the sample in
// the current channel, stored
// as relative path
FLP_Text_URL = FLP_Text + 5,
FLP_Text_CommentRTF = FLP_Text + 6, // new comments in Rich Text
// format
FLP_Version = FLP_Text + 7,
FLP_Text_PluginName = FLP_Text + 9, // plugin file name
// (without path)
FLP_MIDICtrls = FLP_Text + 16,
FLP_Delay = FLP_Text + 17,
FLP_TS404Params = FLP_Text + 18,
FLP_DelayLine = FLP_Text + 19,
FLP_NewPlugin = FLP_Text + 20,
FLP_PluginParams = FLP_Text + 21,
FLP_ChanParams = FLP_Text + 23,// block of various channel
// params (can grow)
FLP_EnvLfoParams = FLP_Text + 26,
FLP_FilterParams = FLP_Text + 27,
FLP_PatternNotes = FLP_Text + 32,
FLP_StepData = FLP_Text + 33,
FLP_CmdCount
} ;
enum flPlugins
{
FL_Plugin_3x_Osc,
FL_Plugin_Sampler,
FL_Plugin_Plucked,
FL_Plugin_SimSynth,
FL_Plugin_DX10,
FL_Plugin_Sytrus,
FL_Plugin_WASP,
FL_Plugin_Undef
} ;
class instrument;
struct FL_Channel;
class flpImport : public importFilter
{
@@ -178,8 +53,7 @@ public:
private:
virtual bool tryImport( trackContainer * _tc );
bool processPluginParams( const flPlugins _plugin, const char * _data,
const int _data_len, instrument * _i );
void processPluginParams( FL_Channel * _ch );
inline int readInt( int _bytes )
{
@@ -226,15 +100,6 @@ private:
}
typedef QList<QPair<int, note> > patternNoteVector;
patternNoteVector m_notes;
typedef QList<int> stepVector;
stepVector m_steps;
typedef QList<Uint32> playListItems;
playListItems m_plItems;
} ;

View File

@@ -4,7 +4,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -33,6 +33,8 @@
* 22 Sep 01, tuorfa@yahoo.com: added comment blocks
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
* 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions
* 16 Dec 07, daved@physiol.usyd.edu.au: fixed fore/background_begin error
* and updated to GPL v3
*--------------------------------------------------------------------*/
#ifdef LMMS_HAVE_CONFIG_H
@@ -106,10 +108,10 @@ attr_express_begin (int attr, const char* param) {
switch(attr)
{
case ATTR_BOLD:
outstring+=QString("%1").arg(op->bold_begin);
outstring+=QString().sprintf(op->bold_begin);
break;
case ATTR_ITALIC:
outstring+=QString("%1").arg(op->italic_begin);
outstring+=QString().sprintf(op->italic_begin);
break;
/* Various underlines, they all resolve to HTML's <u> */
@@ -121,11 +123,11 @@ attr_express_begin (int attr, const char* param) {
case ATTR_2DOT_DASH_UL:
case ATTR_WORD_UL:
case ATTR_UNDERLINE:
outstring+=QString("%1").arg(op->underline_begin);
outstring+=QString().sprintf(op->underline_begin);
break;
case ATTR_DOUBLE_UL:
outstring+=QString("%1").arg(op->dbl_underline_begin);
outstring+=QString().sprintf(op->dbl_underline_begin);
break;
case ATTR_FONTSIZE:
@@ -133,48 +135,48 @@ attr_express_begin (int attr, const char* param) {
break;
case ATTR_FONTFACE:
outstring+=QString("%1").arg(op->font_begin,param);
outstring+=QString().sprintf(op->font_begin,param);
break;
case ATTR_FOREGROUND:
outstring+=QString("%1").arg(op->foreground_begin, param);
outstring+=QString().sprintf(op->foreground_begin, param);
break;
case ATTR_BACKGROUND:
if (!simple_mode)
outstring+=QString("%1").arg(op->foreground_begin,param);
outstring+=QString().sprintf(op->background_begin,param);
break;
case ATTR_SUPER:
outstring+=QString("%1").arg(op->superscript_begin);
outstring+=QString().sprintf(op->superscript_begin);
break;
case ATTR_SUB:
outstring+=QString("%1").arg(op->subscript_begin);
outstring+=QString().sprintf(op->subscript_begin);
break;
case ATTR_STRIKE:
outstring+=QString("%1").arg(op->strikethru_begin);
outstring+=QString().sprintf(op->strikethru_begin);
break;
case ATTR_DBL_STRIKE:
outstring+=QString("%1").arg(op->dbl_strikethru_begin);
outstring+=QString().sprintf(op->dbl_strikethru_begin);
break;
case ATTR_EXPAND:
outstring+=QString("%1").arg(op->expand_begin, param);
outstring+=QString().sprintf(op->expand_begin, param);
break;
case ATTR_OUTLINE:
outstring+=QString("%1").arg(op->outline_begin);
outstring+=QString().sprintf(op->outline_begin);
break;
case ATTR_SHADOW:
outstring+=QString("%1").arg(op->shadow_begin);
outstring+=QString().sprintf(op->shadow_begin);
break;
case ATTR_EMBOSS:
outstring+=QString("%1").arg(op->emboss_begin);
outstring+=QString().sprintf(op->emboss_begin);
break;
case ATTR_ENGRAVE:
outstring+=QString("%1").arg(op->engrave_begin);
outstring+=QString().sprintf(op->engrave_begin);
break;
case ATTR_CAPS:
@@ -187,7 +189,7 @@ attr_express_begin (int attr, const char* param) {
simulate_smallcaps = TRUE;
else {
if (op->small_caps_begin)
outstring+=QString("%1").arg(op->small_caps_begin);
outstring+=QString().sprintf(op->small_caps_begin);
}
break;
}
@@ -207,10 +209,10 @@ attr_express_end (int attr, char *param)
switch(attr)
{
case ATTR_BOLD:
outstring+=QString("%1").arg(op->bold_end);
outstring+=QString().sprintf(op->bold_end);
break;
case ATTR_ITALIC:
outstring+=QString("%1").arg(op->italic_end);
outstring+=QString().sprintf(op->italic_end);
break;
/* Various underlines, they all resolve to HTML's </u> */
@@ -222,11 +224,11 @@ attr_express_end (int attr, char *param)
case ATTR_2DOT_DASH_UL:
case ATTR_WORD_UL:
case ATTR_UNDERLINE:
outstring+=QString("%1").arg(op->underline_end);
outstring+=QString().sprintf(op->underline_end);
break;
case ATTR_DOUBLE_UL:
outstring+=QString("%1").arg(op->dbl_underline_end);
outstring+=QString().sprintf(op->dbl_underline_end);
break;
case ATTR_FONTSIZE:
@@ -234,47 +236,47 @@ attr_express_end (int attr, char *param)
break;
case ATTR_FONTFACE:
outstring+=QString("%1").arg(op->font_end);
outstring+=QString().sprintf(op->font_end);
break;
case ATTR_FOREGROUND:
outstring+=QString("%1").arg(op->foreground_end);
outstring+=QString().sprintf(op->foreground_end);
break;
case ATTR_BACKGROUND:
if (!simple_mode)
outstring+=QString("%1").arg(op->background_end);
outstring+=QString().sprintf(op->background_end);
break;
case ATTR_SUPER:
outstring+=QString("%1").arg(op->superscript_end);
outstring+=QString().sprintf(op->superscript_end);
break;
case ATTR_SUB:
outstring+=QString("%1").arg(op->subscript_end);
outstring+=QString().sprintf(op->subscript_end);
break;
case ATTR_STRIKE:
outstring+=QString("%1").arg(op->strikethru_end);
outstring+=QString().sprintf(op->strikethru_end);
break;
case ATTR_DBL_STRIKE:
outstring+=QString("%1").arg(op->dbl_strikethru_end);
outstring+=QString().sprintf(op->dbl_strikethru_end);
break;
case ATTR_OUTLINE:
outstring+=QString("%1").arg(op->outline_end);
outstring+=QString().sprintf(op->outline_end);
break;
case ATTR_SHADOW:
outstring+=QString("%1").arg(op->shadow_end);
outstring+=QString().sprintf(op->shadow_end);
break;
case ATTR_EMBOSS:
outstring+=QString("%1").arg(op->emboss_end);
outstring+=QString().sprintf(op->emboss_end);
break;
case ATTR_ENGRAVE:
outstring+=QString("%1").arg(op->engrave_end);
outstring+=QString().sprintf(op->engrave_end);
break;
case ATTR_EXPAND:
outstring+=QString("%1").arg(op->expand_end);
outstring+=QString().sprintf(op->expand_end);
break;
case ATTR_CAPS:
@@ -287,7 +289,7 @@ attr_express_end (int attr, char *param)
simulate_smallcaps = FALSE;
else {
if (op->small_caps_end)
outstring+=QString("%1").arg(op->small_caps_end);
outstring+=QString().sprintf(op->small_caps_end);
}
break;
}
@@ -331,6 +333,42 @@ attr_push(int attr, const char* param)
attr_express_begin(attr, param);
}
#if 1 /* daved 0.20.2 */
/*========================================================================
* Name: attr_get_param
* Purpose: Reads an attribute from the current attribute stack.
* Args: Attribute number
* Returns: string.
*=======================================================================*/
char *
attr_get_param(int attr)
{
int i;
AttrStack *stack = stack_of_stacks_top;
if (!stack) {
warning_handler("No stack to get attribute from");
return NULL;
}
i=stack->tos;
while (i>=0)
{
if(stack->attr_stack [i] == attr)
{
if(stack->attr_stack_params [i] != NULL)
return stack->attr_stack_params [i];
else
return NULL;
}
i--;
}
return NULL;
}
#endif
/*========================================================================
* Name: attrstack_copy_all

View File

@@ -4,7 +4,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -32,11 +32,13 @@
* 18 Sep 01, tuorfa@yahoo.com: updates for AttrStack paradigm
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
* 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
*--------------------------------------------------------------------*/
#ifndef _ATTR
#define _ATTR
enum {
ATTR_NONE=0,
ATTR_BOLD, ATTR_ITALIC,
@@ -90,6 +92,13 @@ extern void attr_pop_all();
extern void attr_pop_dump();
#if 1 /* daved 0.20.2 */
char * attr_get_param(int attr);
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -28,7 +28,8 @@
* Purpose: Definitions for the conversion module
*----------------------------------------------------------------------
* Changes:
* 31 March 2005 by daved@physiol.usyd.edu.au: changes requested by ZT Smith
* 31 Mar 05, by daved@physiol.usyd.edu.au: changes requested by ZT Smith
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
*--------------------------------------------------------------------*/
@@ -38,7 +39,7 @@ enum {
CHARSET_ANSI=1,
CHARSET_MAC,
CHARSET_CP437,
CHARSET_CP850
CHARSET_CP850,
};
#ifndef _WORD
@@ -48,9 +49,10 @@ enum {
extern void word_print (Word*, QString & _s);
#if 1 /* daved 0.19.6 - support for multiple char number->output tables */
short numchar_table;
extern short numchar_table;
#define FONTROMAN_TABLE 0
#define FONTSYMBOL_TABLE 1
#define FONTGREEK_TABLE 2
#endif
#define _CONVERT

View File

@@ -5,7 +5,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -35,6 +35,9 @@
* 09 Oct 03, daved@physiol.usyd.edu.au: changed to GNU website
* 17 Feb 04, marcossamaral@terra.com.br: changed some information
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
* 17 Dec 07, daved@physiol.usyd.edu.au: added --noremap to usage - from
* David Santinoli
*--------------------------------------------------------------------*/
@@ -61,7 +64,7 @@
#endif
#define USAGE "unrtf [--version] [--verbose] [--help] [--nopict|-n] [--html] [--text] [--vt] [--latex] [-t html|text|vt|latex] <filename>"
#define USAGE "unrtf [--version] [--verbose] [--help] [--nopict|-n] [--noremap] [--html] [--text] [--vt] [--latex] [-t html|text|vt|latex] <filename>"
/* Default names for RTF's default fonts */

View File

@@ -4,7 +4,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -37,6 +37,7 @@
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
* 22 Aug 05, ax2groin@arbornet.org: added lineno to error_handler
* 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
*--------------------------------------------------------------------*/
#ifdef LMMS_HAVE_CONFIG_H

View File

@@ -4,7 +4,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -30,6 +30,7 @@
* Changes
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
* 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
*--------------------------------------------------------------------*/

View File

@@ -4,7 +4,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -38,6 +38,7 @@
* 08 Oct 03, daved@physiol.usyd.edu.au: some type fixes
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requsted by ZT Smith
* 06 Jan 06, marcossamaral@terra.com.br: changes hash_stats function
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
*--------------------------------------------------------------------*/
#ifdef LMMS_HAVE_CONFIG_H

View File

@@ -4,7 +4,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -29,6 +29,7 @@
* Changes:
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
* 06 Jan 06, marcossamaral@terra.com.br: changes hash_stats()
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
*--------------------------------------------------------------------*/

View File

@@ -4,7 +4,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -39,6 +39,8 @@
* 19 Aug 05, ax2groin@arbornet.org: added more chars and changes to ANSI
* 05 Jan 06, marcossamaral@terra.com.br: fixed bugs #14982 and #14983
* 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions
* 13 Dec 07, daved@physiol.usyd.edu.au: fixed some missing entity ';'
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
*--------------------------------------------------------------------*/
#ifdef LMMS_HAVE_CONFIG_H
@@ -644,8 +646,8 @@ static const char* cp437 [] = {
/* 0x9b */ "&cent;",
/* 0x9c */ "&pound;",
/* 0x9d */ "&yen;",
/* 0x9e */ "&#8359", /* peseta */
/* 0x9f */ "&#402", /* small f with hook */
/* 0x9e */ "&#8359;", /* peseta */
/* 0x9f */ "&#402;", /* small f with hook */
/* 0xa0 */ "&aacute;",
/* 0xa1 */ "&iacute;",
/* 0xa2 */ "&oacute;",
@@ -655,7 +657,7 @@ static const char* cp437 [] = {
/* 0xa6 */ "&ordf;",
/* 0xa7 */ "&frac14;",
/* 0xa8 */ "&iquest;",
/* 0xa9 */ "&#8976", /* reversed not */
/* 0xa9 */ "&#8976;", /* reversed not */
/* 0xaa */ "&not;",
/* 0xab */ "&frac12;",
/* 0xac */ "&raquo;",
@@ -874,6 +876,159 @@ static const char* cp850 [] = {
/* 0xfe */ "&#9632;", /* black square */
/* 0xff */ "&nbsp;",
};
#if 1 /* daved - 0.20.3 */
static char * Greek[] =
{
/* 0x80 */ "&ccedil;",
/* 0x81 */ "&uuml;",
/* 0x82 */ "&eacute;",
/* 0x83 */ "&acirc;",
/* 0x84 */ "&auml;",
/* 0x85 */ "&agrave;",
/* 0x86 */ "&aring;",
/* 0x87 */ "&ccedil;",
/* 0x88 */ "&ecirc;",
/* 0x89 */ "&euml;",
/* 0x8a */ "&egrave;",
/* 0x8b */ "&iuml;",
/* 0x8c */ "&icirc;",
/* 0x8d */ "&igrave;",
/* 0x8e */ "&auml;",
/* 0x8f */ "&aring;",
/* 0x90 */ "&eacute;",
/* 0x91 */ "&aelig;",
/* 0x92 */ "&aelig;",
/* 0x93 */ "&ocirc;",
/* 0x94 */ "&ouml;",
/* 0x95 */ "&ograve;",
/* 0x96 */ "&ucirc;",
/* 0x97 */ "&ugrave;",
/* 0x98 */ "&yuml;",
/* 0x99 */ "&ouml;",
/* 0x9a */ "&uuml;",
/* 0x9b */ "&oslash;",
/* 0x9c */ "&pound;",
/* 0x9d */ "&oslash;",
/* 0x9e */ "&times;",
/* 0x9f */ "&#402;", /* small f with hook */
/* 0xa0 */ "&aacute;",
/* 0xa1 */ "&iacute;",
/* 0xa2 */ "&oacute;",
/* 0xa3 */ "&uacute;",
/* 0xa4 */ "&ntilde;",
/* 0xa5 */ "&ntilde;",
/* 0xa6 */ "&ordf;",
/* 0xa7 */ "&frac14;",
/* 0xa8 */ "&iquest;",
/* 0xa9 */ "&reg;",
/* 0xaa */ "&not;",
/* 0xab */ "&frac12;",
/* 0xac */ "&raquo;",
/* 0xad */ "&iexcl;",
/* 0xae */ "&laquo;",
/* 0xaf */ "&ordm;",
/* 0xb0 */ "&#9617;", /* light shade */
/* 0xb1 */ "&#9618;", /* med. shade */
/* 0xb2 */ "&#9619;", /* dark shade */
/* 0xb3 */ "&#9474;", /* box-draw light vert. */
/* 0xb4 */ "&#9508;", /* box-draw light vert. + lt. */
/* 0xb5 */ "&aacute;",
/* 0xb6 */ "&acirc;",
/* 0xb7 */ "&agrave;",
/* 0xb8 */ "&copy;",
/* 0xb9 */ "&#9571;", /* box-draw dbl. vert. + lt. */
/* 0xba */ "&#9553;", /* box-draw dbl. vert. */
/* 0xbb */ "&#9559;", /* box-draw dbl. dn. + lt. */
/* 0xbc */ "&#9565;", /* box-draw dbl. up + lt. */
/* 0xbd */ "&cent;",
/* 0xbe */ "&yen;",
/* 0xbf */ "&#9488;", /* box-draw light dn. + lt. */
/* 0xc0 */ "&#9492;", /* box-draw light up + rt. */
/* 0xc1 */ "&#9524;", /* box-draw light up + horiz. */
/* 0xc2 */ "&#9516;", /* box-draw light dn. + horiz. */
/* 0xc3 */ "&#9500;", /* box-draw light vert. + rt. */
/* 0xc4 */ "&#9472;", /* box-draw light horiz. */
/* 0xc5 */ "&#9532;", /* box-draw light vert. + horiz. */
/* 0xc6 */ "&atilde;",
/* 0xc7 */ "&atilde;",
/* 0xc8 */ "&#9562;", /* box-draw dbl. up + rt. */
/* 0xc9 */ "&#9556;", /* box-draw dbl. dn. + rt. */
/* 0xca */ "&#9577;", /* box-draw dbl. up + horiz. */
/* 0xcb */ "&#9574;", /* box-draw dbl. dn. + horiz. */
/* 0xcc */ "&#9568;", /* box-draw dbl. vert. + rt. */
/* 0xcd */ "&#9552;", /* box-draw dbl. horiz. */
/* 0xce */ "&#9580;", /* box-draw dbl. vert. + horiz. */
/* 0xcf */ "&curren;",
/* 0xd0 */ "&eth;",
/* 0xd1 */ "&eth;",
/* 0xd2 */ "&ecirc;",
/* 0xd3 */ "&euml;",
/* 0xd4 */ "&egrave;",
/* 0xd5 */ "&#305;", /* small dotless i */
/* 0xd6 */ "&iacute;",
/* 0xd7 */ "&icirc;",
/* 0xd8 */ "&iuml;",
/* 0xd9 */ "&#9496;", /* box-draw light up + lt. */
/* 0xda */ "&#9484;", /* box-draw light dn. + rt. */
/* 0xdb */ "&#9608;", /* full-block */
/* 0xdc */ "&#9604;", /* lower 1/2 block */
/* 0xdd */ "&brvbar;",
/* 0xde */ "&igrave;",
/* 0xdf */ "&#9600;", /* upper 1/2 block */
/* 0xe0 */ "&oacute;",
/* above here not done */
/* 0xe1 */ "&alpha;",
/* 0xe2 */ "&beta;",
/* 0xe3 */ "&gamma;",
/* 0xe4 */ "&delta;",
/* 0xe5 */ "&epsilon;",
/* 0xe6 */ "&zeta;",
/* 0xe7 */ "&eta;",
/* 0xe8 */ "&theta;",
/* 0xe9 */ "&iota;",
/* 0xea */ "&kappa;",
/* 0xeb */ "&lambda;",
/* 0xec */ "&mu;",
/* 0xed */ "&nu;",
/* 0xee */ "&xi;",
/* 0xef */ "&omicron;",
/* 0xf0 */ "&pi;",
/* 0xf1 */ "&rho;",
/* 0xf2 */ "&sigmaf;",
/* 0xf3 */ "&sigma;",
/* 0xf4 */ "&tau;",
/* 0xf5 */ "&upsilon;",
/* 0xf6 */ "&phi;",
/* 0xf7 */ "&chi;",
/* 0xf8 */ "&psi;",
/* 0xf9 */ "&omiga;",
/* 0xfa */ "&iotauml;",
/* 0xfb */ "&nuuml;",
/* 0xfc */ "&omicronacute;",
/* 0xfd */ "&nuacute;",
/* 0xfe */ "&omegaacute;", /* black square */
/* 0xff */ "&nbsp;",
};
#endif
/*========================================================================
* Name: html_unisymbol_print
* Purpose: Outputs arbitrary unicode symbol
* Args: Unsigned Short.
* Returns: String representing symbol.
*=======================================================================*/
char *
html_unisymbol_print (unsigned short c)
{
char r[12];
snprintf(r, 9, "&#%04d;", c);
return my_strdup(r);
}
@@ -1098,6 +1253,13 @@ html_init (void)
op->symbol_last_char = 254;
op->symbol_translation_table = symbol;
#endif
#if 1 /* daved - 0.20.3 - GREEK font support */
op->greek_first_char = 0x80;
op->greek_last_char = 0xff;
op->greek_translation_table = Greek;
#endif
op->unisymbol_print = html_unisymbol_print;
return op;
}

View File

@@ -4,7 +4,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -28,6 +28,7 @@
*----------------------------------------------------------------------
* Changes:
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
*--------------------------------------------------------------------*/

View File

@@ -4,7 +4,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -30,6 +30,7 @@
* 15 Oct 00, tuorfa@yahoo.com: removed echo_mode extern
* 19 Sep 01, tuorfa@yahoo.com: added output personality
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
*--------------------------------------------------------------------*/

View File

@@ -4,7 +4,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -35,6 +35,7 @@
* 08 Oct 03, daved@physiol.usyd.edu.au: added stdlib.h for linux
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
* 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
*--------------------------------------------------------------------*/
#ifdef LMMS_HAVE_CONFIG_H

View File

@@ -4,7 +4,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -29,6 +29,7 @@
* Changes:
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
* 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
*--------------------------------------------------------------------*/
extern char * my_malloc (unsigned long);

View File

@@ -4,7 +4,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -34,6 +34,9 @@
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
* 06 Jan 06, marcossamaral@terra.com.br: changes in STDOUT
* 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
* 17 Dec 07, daved@physiol.usyd.edu.au: added support for --noremap from
* David Santinoli
*--------------------------------------------------------------------*/
@@ -114,16 +117,27 @@ op_free (OutputPersonality *op)
const char *
#if 1 /* daved - 0.19.6 */
op_translate_char (OutputPersonality *op, int charset, int ch, int ntable)
op_translate_char (OutputPersonality *op, int charset, CodepageInfo *codepage, int ch, int ntable)
#else
op_translate_char (OutputPersonality *op, int charset, int ch)
op_translate_char (OutputPersonality *op, int charset, CodepageInfo *codepage, int ch)
#endif
{
short start;
const char *result=NULL;
#if 1 /* daved - 0.20.5 */
static char output_buffer[2]={ 0, 0 };
#endif
CHECK_PARAM_NOT_NULL(op);
#if 1 /* daved - 0.20.5 */
if (no_remap_mode == TRUE && ch < 256)
{
output_buffer[0]=ch;
result=output_buffer;
}
else
#endif
#if 1 /* daved - 0.19.6 */
/* if we are seeking a character from a symbol font we can
be below 0x80
@@ -134,8 +148,21 @@ op_translate_char (OutputPersonality *op, int charset, int ch)
if(ch >= start && ch <= op->symbol_last_char)
result = op->symbol_translation_table[ch - start];
if(result)
return result;
}
else
#endif
#if 1 /* daved - 0.20.3 */
if(ntable == FONTGREEK_TABLE)
{
start = op->greek_first_char;
if(ch >= start && ch <= op->greek_last_char)
result = op->greek_translation_table[ch - start];
if(result)
return result;
}
#endif
if (ch >= 0x20 && ch < 0x80) {
result = op->ascii_translation_table [ch - 0x20];
@@ -149,10 +176,23 @@ op_translate_char (OutputPersonality *op, int charset, int ch)
else
switch (charset) {
case CHARSET_ANSI:
if (codepage != NULL && op->unisymbol_print != NULL && codepage->cp)
{
if(0)
printf("<CODEPAGE CHAR %d>", codepage->chars[ch - 0x80]);
if (codepage->chars[ch - 0x80]) {
if(0)
printf("<UNIPRINTING>");
result = op->unisymbol_print(codepage->chars[ch - 0x80]);
}
}
if(!result)
{
start = op->ansi_first_char;
if (ch >= start &&
ch <= op->ansi_last_char)
result = op->ansi_translation_table [ch-start];
if (ch >= start &&
ch <= op->ansi_last_char)
result = op->ansi_translation_table [ch-start];
}
break;
case CHARSET_MAC:
start = op->mac_first_char;
@@ -198,49 +238,49 @@ op_begin_std_fontsize (OutputPersonality *op, int size)
switch (size) {
case 8:
if (op->fontsize8_begin) {
outstring+=QString("%1").arg (op->fontsize8_begin);
outstring+=QString().sprintf(op->fontsize8_begin);
found_std_expr = TRUE;
}
break;
case 10:
if (op->fontsize10_begin) {
outstring+=QString("%1").arg (op->fontsize10_begin);
outstring+=QString().sprintf(op->fontsize10_begin);
found_std_expr = TRUE;
}
break;
case 12:
if (op->fontsize12_begin) {
outstring+=QString("%1").arg (op->fontsize12_begin);
outstring+=QString().sprintf(op->fontsize12_begin);
found_std_expr = TRUE;
}
break;
case 14:
if (op->fontsize14_begin) {
outstring+=QString("%1").arg (op->fontsize14_begin);
outstring+=QString().sprintf(op->fontsize14_begin);
found_std_expr = TRUE;
}
break;
case 18:
if (op->fontsize18_begin) {
outstring+=QString("%1").arg (op->fontsize18_begin);
outstring+=QString().sprintf(op->fontsize18_begin);
found_std_expr = TRUE;
}
break;
case 24:
if (op->fontsize24_begin) {
outstring+=QString("%1").arg (op->fontsize24_begin);
outstring+=QString().sprintf(op->fontsize24_begin);
found_std_expr = TRUE;
}
break;
case 36:
if (op->fontsize36_begin) {
outstring+=QString("%1").arg (op->fontsize36_begin);
outstring+=QString().sprintf(op->fontsize36_begin);
found_std_expr = TRUE;
}
break;
case 48:
if (op->fontsize48_begin) {
outstring+=QString("%1").arg (op->fontsize48_begin);
outstring+=QString().sprintf(op->fontsize48_begin);
found_std_expr = TRUE;
}
break;
@@ -253,53 +293,53 @@ op_begin_std_fontsize (OutputPersonality *op, int size)
if (op->fontsize_begin) {
char expr[16];
sprintf (expr, "%d", size);
outstring+=QString("%1").arg (op->fontsize_begin, expr);
outstring+=QString().sprintf(op->fontsize_begin, expr);
} else {
/* If we cannot write out a change for the exact
* point size, we must approximate to a standard
* size.
*/
if (size<9 && op->fontsize8_begin) {
outstring+=QString("%1").arg (op->fontsize8_begin);
outstring+=QString().sprintf(op->fontsize8_begin);
} else
if (size<11 && op->fontsize10_begin) {
outstring+=QString("%1").arg (op->fontsize10_begin);
outstring+=QString().sprintf(op->fontsize10_begin);
} else
if (size<13 && op->fontsize12_begin) {
outstring+=QString("%1").arg (op->fontsize12_begin);
outstring+=QString().sprintf(op->fontsize12_begin);
} else
if (size<16 && op->fontsize14_begin) {
outstring+=QString("%1").arg (op->fontsize14_begin);
outstring+=QString().sprintf(op->fontsize14_begin);
} else
if (size<21 && op->fontsize18_begin) {
outstring+=QString("%1").arg (op->fontsize18_begin);
outstring+=QString().sprintf(op->fontsize18_begin);
} else
if (size<30 && op->fontsize24_begin) {
outstring+=QString("%1").arg (op->fontsize24_begin);
outstring+=QString().sprintf(op->fontsize24_begin);
} else
if (size<42 && op->fontsize36_begin) {
outstring+=QString("%1").arg (op->fontsize36_begin);
outstring+=QString().sprintf(op->fontsize36_begin);
} else
if (size>40 && op->fontsize48_begin) {
outstring+=QString("%1").arg (op->fontsize48_begin);
outstring+=QString().sprintf(op->fontsize48_begin);
} else
/* If we can't even produce a good approximation,
* just try to get a font size near 12 point.
*/
if (op->fontsize12_begin)
outstring+=QString("%1").arg (op->fontsize12_begin);
outstring+=QString().sprintf(op->fontsize12_begin);
else
if (op->fontsize14_begin)
outstring+=QString("%1").arg (op->fontsize14_begin);
outstring+=QString().sprintf(op->fontsize14_begin);
else
if (op->fontsize10_begin)
outstring+=QString("%1").arg (op->fontsize10_begin);
outstring+=QString().sprintf(op->fontsize10_begin);
else
if (op->fontsize18_begin)
outstring+=QString("%1").arg (op->fontsize18_begin);
outstring+=QString().sprintf(op->fontsize18_begin);
else
if (op->fontsize8_begin)
outstring+=QString("%1").arg (op->fontsize8_begin);
outstring+=QString().sprintf(op->fontsize8_begin);
else
error_handler ("output personality lacks sufficient font size change capability");
}
@@ -327,49 +367,49 @@ op_end_std_fontsize (OutputPersonality *op, int size)
switch (size) {
case 8:
if (op->fontsize8_end) {
outstring+=QString("%1").arg (op->fontsize8_end);
outstring+=QString().sprintf(op->fontsize8_end);
found_std_expr = TRUE;
}
break;
case 10:
if (op->fontsize10_end) {
outstring+=QString("%1").arg (op->fontsize10_end);
outstring+=QString().sprintf(op->fontsize10_end);
found_std_expr = TRUE;
}
break;
case 12:
if (op->fontsize12_end) {
outstring+=QString("%1").arg (op->fontsize12_end);
outstring+=QString().sprintf(op->fontsize12_end);
found_std_expr = TRUE;
}
break;
case 14:
if (op->fontsize14_end) {
outstring+=QString("%1").arg (op->fontsize14_end);
outstring+=QString().sprintf(op->fontsize14_end);
found_std_expr = TRUE;
}
break;
case 18:
if (op->fontsize18_end) {
outstring+=QString("%1").arg (op->fontsize18_end);
outstring+=QString().sprintf(op->fontsize18_end);
found_std_expr = TRUE;
}
break;
case 24:
if (op->fontsize24_end) {
outstring+=QString("%1").arg (op->fontsize24_end);
outstring+=QString().sprintf(op->fontsize24_end);
found_std_expr = TRUE;
}
break;
case 36:
if (op->fontsize36_end) {
outstring+=QString("%1").arg (op->fontsize36_end);
outstring+=QString().sprintf(op->fontsize36_end);
found_std_expr = TRUE;
}
break;
case 48:
if (op->fontsize48_end) {
outstring+=QString("%1").arg (op->fontsize48_end);
outstring+=QString().sprintf(op->fontsize48_end);
found_std_expr = TRUE;
}
break;
@@ -382,53 +422,53 @@ op_end_std_fontsize (OutputPersonality *op, int size)
if (op->fontsize_end) {
char expr[16];
sprintf (expr, "%d", size);
outstring+=QString("%1").arg (op->fontsize_end, expr);
outstring+=QString().sprintf(op->fontsize_end, expr);
} else {
/* If we cannot write out a change for the exact
* point size, we must approximate to a standard
* size.
*/
if (size<9 && op->fontsize8_end) {
outstring+=QString("%1").arg (op->fontsize8_end);
outstring+=QString().sprintf(op->fontsize8_end);
} else
if (size<11 && op->fontsize10_end) {
outstring+=QString("%1").arg (op->fontsize10_end);
outstring+=QString().sprintf(op->fontsize10_end);
} else
if (size<13 && op->fontsize12_end) {
outstring+=QString("%1").arg (op->fontsize12_end);
outstring+=QString().sprintf(op->fontsize12_end);
} else
if (size<16 && op->fontsize14_end) {
outstring+=QString("%1").arg (op->fontsize14_end);
outstring+=QString().sprintf(op->fontsize14_end);
} else
if (size<21 && op->fontsize18_end) {
outstring+=QString("%1").arg (op->fontsize18_end);
outstring+=QString().sprintf(op->fontsize18_end);
} else
if (size<30 && op->fontsize24_end) {
outstring+=QString("%1").arg (op->fontsize24_end);
outstring+=QString().sprintf(op->fontsize24_end);
} else
if (size<42 && op->fontsize36_end) {
outstring+=QString("%1").arg (op->fontsize36_end);
outstring+=QString().sprintf(op->fontsize36_end);
} else
if (size>40 && op->fontsize48_end) {
outstring+=QString("%1").arg (op->fontsize48_end);
outstring+=QString().sprintf(op->fontsize48_end);
} else
/* If we can't even produce a good approximation,
* just try to get a font size near 12 point.
*/
if (op->fontsize12_end)
outstring+=QString("%1").arg (op->fontsize12_end);
outstring+=QString().sprintf(op->fontsize12_end);
else
if (op->fontsize14_end)
outstring+=QString("%1").arg (op->fontsize14_end);
outstring+=QString().sprintf(op->fontsize14_end);
else
if (op->fontsize10_end)
outstring+=QString("%1").arg (op->fontsize10_end);
outstring+=QString().sprintf(op->fontsize10_end);
else
if (op->fontsize18_end)
outstring+=QString("%1").arg (op->fontsize18_end);
outstring+=QString().sprintf(op->fontsize18_end);
else
if (op->fontsize8_end)
outstring+=QString("%1").arg (op->fontsize8_end);
outstring+=QString().sprintf(op->fontsize8_end);
else
error_handler ("output personality lacks sufficient font size change capability");
}

View File

@@ -4,7 +4,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -28,12 +28,18 @@
*----------------------------------------------------------------------
* Changes:
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
* 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions
*--------------------------------------------------------------------*/
#ifndef _OUTPUT
typedef struct {
int cp;
unsigned short chars[128];
} CodepageInfo;
typedef struct {
const char *comment_begin;
@@ -276,6 +282,13 @@ typedef struct {
short symbol_last_char;
const char **symbol_translation_table;
#endif
#if 1 /* daved 0.20.3 GREEK font support */
short greek_first_char;
short greek_last_char;
char **greek_translation_table;
#endif
char *(*unisymbol_print) (unsigned short);
void (*write_set_foreground) (int,int,int);
}
@@ -285,9 +298,9 @@ OutputPersonality;
extern OutputPersonality* op_create(void);
extern void op_free (OutputPersonality*);
#if 1 /* daved - 0.19.6 */
extern const char* op_translate_char (OutputPersonality*,int,int, int);
extern const char* op_translate_char (OutputPersonality*,int,CodepageInfo*,int, int);
#else
extern char* op_translate_char (OutputPersonality*,int,int);
extern char* op_translate_char (OutputPersonality*,int,CodepageInfo*,int);
#endif
extern void op_begin_std_fontsize (OutputPersonality*, int);

View File

@@ -4,7 +4,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -36,6 +36,7 @@
* 22 Sep 01, tuorfa@yahoo.com: added function-level comment blocks
* 08 Sep 03, daved@physiol.usyd.edu.au: type fixes; ANSI C fixes
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
*--------------------------------------------------------------------*/
#ifdef LMMS_HAVE_CONFIG_H

View File

@@ -4,7 +4,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -29,6 +29,7 @@
* Changes:
* 15 Oct 00, tuorfa@yahoo.com: parse.h created with functions taken from word.c
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
*--------------------------------------------------------------------*/

View File

@@ -4,7 +4,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -29,6 +29,7 @@
* Changes:
* 22 Sep 01, tuorfa@yahoo.com: added function-level comment blocks
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
*--------------------------------------------------------------------*/
#ifdef LMMS_HAVE_CONFIG_H

View File

@@ -4,7 +4,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -28,6 +28,7 @@
*----------------------------------------------------------------------
* Changes:
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
*--------------------------------------------------------------------*/
extern int h2toi (char *);

View File

@@ -4,7 +4,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -46,6 +46,7 @@
* 22 Sep 01, tuorfa@yahoo.com: added function-level comment blocks
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
* 11 Jan 07, jasp00@users.sourceforge.net: optimized unsafe loop
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
*--------------------------------------------------------------------*/
#ifdef LMMS_HAVE_CONFIG_H

View File

@@ -4,7 +4,7 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -28,6 +28,7 @@
*----------------------------------------------------------------------
* Changes:
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
*--------------------------------------------------------------------*/
#ifndef _WORD

View File

@@ -292,20 +292,23 @@ bool midiImport::readSMF( trackContainer * _tc )
// Tempo stuff
automationPattern * tap = _tc->tempoAutomationPattern();
tap->clear();
Alg_time_map * timeMap = seq->get_time_map();
Alg_beats & beats = timeMap->beats;
for( int i = 0; i < beats.len - 1; i++ )
if( tap )
{
Alg_beat_ptr b = &(beats[i]);
double tempo = ( beats[i + 1].beat - b->beat ) /
( beats[i + 1].time - beats[i].time );
tap->putValue( b->beat * ticksPerBeat, tempo * 60.0 );
}
if( timeMap->last_tempo_flag )
{
Alg_beat_ptr b = &( beats[beats.len - 1] );
tap->putValue( b->beat * ticksPerBeat, timeMap->last_tempo * 60.0 );
tap->clear();
Alg_time_map * timeMap = seq->get_time_map();
Alg_beats & beats = timeMap->beats;
for( int i = 0; i < beats.len - 1; i++ )
{
Alg_beat_ptr b = &(beats[i]);
double tempo = ( beats[i + 1].beat - b->beat ) /
( beats[i + 1].time - beats[i].time );
tap->putValue( b->beat * ticksPerBeat, tempo * 60.0 );
}
if( timeMap->last_tempo_flag )
{
Alg_beat_ptr b = &( beats[beats.len - 1] );
tap->putValue( b->beat * ticksPerBeat, timeMap->last_tempo * 60.0 );
}
}
// Song events
@@ -416,17 +419,17 @@ bool midiImport::readSMF( trackContainer * _tc )
break;
case 7:
objModel = &ch->it->volumeModel();
objModel = ch->it->volumeModel();
cc *= 100.0f;
break;
case 10:
objModel = &ch->it->panningModel();
objModel = ch->it->panningModel();
cc = cc * 200.f - 100.0f;
break;
case 128:
objModel = &ch->it->pitchModel();
objModel = ch->it->pitchModel();
cc = cc * 100.0f;
break;
}