Removed obsolete folders.
@@ -1,5 +0,0 @@
|
||||
*.iml
|
||||
misc.xml
|
||||
modules.xml
|
||||
vcs.xml
|
||||
workspace.xml
|
||||
@@ -1 +0,0 @@
|
||||
OpenTX
|
||||
@@ -1,57 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectCodeStyleSettingsManager">
|
||||
<option name="PER_PROJECT_SETTINGS">
|
||||
<value>
|
||||
<Objective-C>
|
||||
<option name="INDENT_VISIBILITY_KEYWORDS" value="2" />
|
||||
<option name="FUNCTION_BRACE_PLACEMENT" value="2" />
|
||||
<option name="SUPERCLASS_LIST_BEFORE_COLON" value="0" />
|
||||
</Objective-C>
|
||||
<Objective-C-extensions>
|
||||
<file>
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
|
||||
</file>
|
||||
<class>
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
|
||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
|
||||
</class>
|
||||
<extensions>
|
||||
<pair source="cpp" header="h" />
|
||||
<pair source="c" header="h" />
|
||||
</extensions>
|
||||
</Objective-C-extensions>
|
||||
<codeStyleSettings language="CMake">
|
||||
<option name="SPACE_BEFORE_IF_PARENTHESES" value="false" />
|
||||
<option name="SPACE_BEFORE_WHILE_PARENTHESES" value="false" />
|
||||
<option name="SPACE_BEFORE_FOR_PARENTHESES" value="false" />
|
||||
<indentOptions>
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
||||
<option name="TAB_SIZE" value="8" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="ObjectiveC">
|
||||
<option name="CLASS_BRACE_STYLE" value="2" />
|
||||
<indentOptions>
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
<option name="TAB_SIZE" value="8" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
</value>
|
||||
</option>
|
||||
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,32 +0,0 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<option name="RIGHT_MARGIN" value="160" />
|
||||
<Objective-C>
|
||||
<option name="INDENT_C_STRUCT_MEMBERS" value="2" />
|
||||
<option name="INDENT_VISIBILITY_KEYWORDS" value="2" />
|
||||
<option name="FUNCTION_BRACE_PLACEMENT" value="2" />
|
||||
<option name="SUPERCLASS_LIST_BEFORE_COLON" value="0" />
|
||||
<option name="SPACE_AFTER_POINTER_IN_DECLARATION" value="true" />
|
||||
<option name="SPACE_AFTER_REFERENCE_IN_DECLARATION" value="true" />
|
||||
</Objective-C>
|
||||
<codeStyleSettings language="CMake">
|
||||
<option name="SPACE_BEFORE_IF_PARENTHESES" value="false" />
|
||||
<option name="SPACE_BEFORE_WHILE_PARENTHESES" value="false" />
|
||||
<option name="SPACE_BEFORE_FOR_PARENTHESES" value="false" />
|
||||
<indentOptions>
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
||||
<option name="TAB_SIZE" value="8" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
<codeStyleSettings language="ObjectiveC">
|
||||
<option name="CLASS_BRACE_STYLE" value="2" />
|
||||
<option name="ELSE_ON_NEW_LINE" value="true" />
|
||||
<indentOptions>
|
||||
<option name="INDENT_SIZE" value="2" />
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
||||
<option name="TAB_SIZE" value="8" />
|
||||
</indentOptions>
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
||||
@@ -1,5 +0,0 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||
</state>
|
||||
</component>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/companion/targets/windows/license.txt" charset="ISO-8859-1" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,340 +0,0 @@
|
||||
\documentclass[a4paper,french,10pt]{article}
|
||||
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[english]{babel}
|
||||
\usepackage[T1]{fontenc}
|
||||
\usepackage{geometry}
|
||||
\usepackage{hyperref}
|
||||
\usepackage{lmodern} % font Latin Modern, qui n'est pas une police Bitmap, donc tu auras de l'anti aliasing
|
||||
\usepackage{tocloft}
|
||||
\usepackage{booktabs}
|
||||
\usepackage{longtable}
|
||||
\usepackage{xcolor}
|
||||
\usepackage{listings}
|
||||
\usepackage{pifont,mdframed}
|
||||
\usepackage{enumitem}
|
||||
\usepackage[parfill]{parskip}
|
||||
\usepackage{fancyhdr}
|
||||
\usepackage{calc}
|
||||
\usepackage{ifthen}
|
||||
|
||||
\setlength{\parskip}{\baselineskip}
|
||||
|
||||
|
||||
\definecolor{luagray}{rgb}{0.96,0.96,0.96}
|
||||
|
||||
{\renewcommand{\arraystretch}{1.2} %<- modify value to suit your needs
|
||||
%%%%%%%%%%%
|
||||
% Defines the listings Lua style
|
||||
%%%%%%%%%%%
|
||||
\lstdefinestyle{myLuastyle}
|
||||
{
|
||||
language = {[5.0]Lua},
|
||||
basicstyle = \ttfamily\footnotesize,
|
||||
showstringspaces = false,
|
||||
upquote = true,
|
||||
frame = single,
|
||||
captionpos = b,
|
||||
breaklines =true,
|
||||
backgroundcolor = \color{luagray},
|
||||
}
|
||||
|
||||
%%%%%%%%%%
|
||||
% Set the lua style as default listings style
|
||||
%%%%%%%%%%
|
||||
\lstset{style=myLuastyle}
|
||||
|
||||
%%%% On crée une figure Tikz qui permet de mettre le caractère passé en paramètre dans un rond (utilisé pour le symbole information
|
||||
|
||||
\newcommand\encircle[1]{%
|
||||
\tikz[baseline=(X.base)]
|
||||
\node (X) [draw, shape=circle, inner sep=0] {\strut #1};}
|
||||
|
||||
%%% Environnements
|
||||
\newenvironment{warning}
|
||||
{\par\begin{mdframed}[linewidth=2pt,linecolor=red]%
|
||||
\begin{list}{}{\leftmargin=1cm
|
||||
\labelwidth=\leftmargin}\item[\color{red}\Large\ding{53}]}
|
||||
{\end{list}\end{mdframed}\par}
|
||||
|
||||
\newenvironment{info}
|
||||
{\par\begin{mdframed}[linewidth=2pt,linecolor=blue]%
|
||||
\begin{list}{}{\leftmargin=1cm
|
||||
\labelwidth=\leftmargin}\item[\color{blue}\Large\ding{43}]}
|
||||
{\end{list}\end{mdframed}\par}
|
||||
|
||||
|
||||
|
||||
|
||||
\newenvironment{function}[1]
|
||||
{\mdfsetup{
|
||||
skipabove=\topsep,
|
||||
skipbelow=\topsep,
|
||||
innertopmargin=0pt,
|
||||
innerbottommargin=4pt,
|
||||
leftmargin=-13pt,
|
||||
splitbottomskip=0ex,
|
||||
splittopskip=0ex,
|
||||
topline=false,
|
||||
leftline=true,
|
||||
bottomline=false,
|
||||
rightline=false,
|
||||
innerrightmargin=0pt,
|
||||
innerlinewidth=2pt,
|
||||
font=\normalfont,
|
||||
frametitle={\textbf{local #1.}},
|
||||
linecolor=black,
|
||||
}
|
||||
\begin{mdframed}%
|
||||
}
|
||||
{\end{mdframed}}
|
||||
|
||||
|
||||
|
||||
|
||||
\geometry{top=2cm,bottom=2cm,left=2cm,right=1.5cm}
|
||||
|
||||
|
||||
|
||||
\pagestyle{fancy}
|
||||
\renewcommand{\sectionmark}[1]{\markright{#1}}
|
||||
\renewcommand{\footrulewidth}{1pt}
|
||||
\fancyhf{}
|
||||
\rhead{\fancyplain{}{Lua Scripting in OpenTx - Reference Guide }}
|
||||
\lhead{\fancyplain{}{\rightmark }}
|
||||
\rfoot{\fancyplain{}{\thepage}}
|
||||
\lfoot{\fancyplain{}{Version 1.0}}
|
||||
|
||||
|
||||
\title {
|
||||
\vspace{60mm}
|
||||
\Huge{\textsc{Lua Scripting in OpenTx\\}
|
||||
\vspace{8mm}
|
||||
\LARGE{\textsc{Reference Guide}}}
|
||||
\vspace{45mm}
|
||||
}
|
||||
|
||||
|
||||
\author{OpenTx Team @ \url{http://www.open-tx.org/}}
|
||||
|
||||
\date{Version 1.0}
|
||||
|
||||
|
||||
\begin{document}
|
||||
|
||||
\maketitle
|
||||
\newpage
|
||||
|
||||
\tableofcontents
|
||||
\newpage
|
||||
|
||||
\section{Introduction}
|
||||
\paragraph{}
|
||||
OpenTX 2.0 added support for Lua (current version 5.2.2) user scripts.
|
||||
|
||||
Lua is a lightweight multi-paradigm programming language designed as a scripting language\footnote{More at \href{http://www.wikipedia.org}{Wikipedia}}.
|
||||
|
||||
There are several types of Lua scripts used in openTX. More general information about Lua scripts can be found on page \url{http://www.open-tx.org/lua-instructions.html}
|
||||
|
||||
Lua scripts must be placed on SD card in correct folders and have an extension .lua. Maximum Lua script file name length is TODO characters. The script folders have been reorganized in OpenTX 2.0.3. The folder structure looks like this:
|
||||
|
||||
\begin{itemize}[leftmargin=*,itemsep=5mm,nolistsep]
|
||||
\item[] \texttt{/SCRIPTS/WIZARD/} - For the Wizard script
|
||||
\item[] \texttt{/SCRIPTS/MIXES/} - For model scripts
|
||||
\item[] \texttt{/SCRIPTS/FUNCTIONS/} - For function scripts
|
||||
\item[] \texttt{/SCRIPTS/<MODEL\_NAME>/telemXX.lua} - For telemetry scripts
|
||||
\item[] \texttt{/SCRIPTS/TEMPLATES/} - For template scripts
|
||||
\end{itemize}
|
||||
|
||||
\begin{figure}[h]
|
||||
\begin{center}
|
||||
\begin{longtable}{ll}
|
||||
\toprule
|
||||
\textbf{Lua Standard Libraries} & \textbf{Included} \\
|
||||
\midrule
|
||||
\endhead
|
||||
\texttt{package} & no \\
|
||||
\texttt{coroutine} & no \\
|
||||
\texttt{table} & no \\
|
||||
\texttt{io} & no \\
|
||||
\texttt{os} & no \\
|
||||
\texttt{string} & no \\
|
||||
\texttt{bit} & future 2.1.0? \\
|
||||
\texttt{math} & available from 2.0.0\\
|
||||
\texttt{debug} & no \\
|
||||
\bottomrule
|
||||
\end{longtable}
|
||||
\caption{Packaged libraries}
|
||||
\end{center}
|
||||
\end{figure}
|
||||
\newpage
|
||||
|
||||
\section{Model Scripts}
|
||||
|
||||
\begin{warning}
|
||||
Do not use Lua model scripts for controlling any aspect of your model that could cause a crash if script stops executing.
|
||||
\end{warning}
|
||||
|
||||
\subsection{General description}
|
||||
\paragraph{}
|
||||
Each model can have several model scripts associated with it. These scripts are run periodically for entire time that model is selected/active. These scripts behave similar to standard OpenTX mixers but at the same time provide much more flexible and powerful tool.
|
||||
|
||||
|
||||
Typically model scripts take several values as inputs, do some calculation or logic processing based on them and output one or more values. Each run of scripts should be as short as possible. Exceeding certain script execution runtime will result in script being forcefully stopped and disabled.
|
||||
|
||||
See also :
|
||||
\begin{itemize}[leftmargin=*,itemsep=5mm,nolistsep]
|
||||
\item[-] Lua \href{dunno}{One-time Scripts} - one-time running general scripts
|
||||
\item[-] Lua \href{dunno}{Function Scripts}
|
||||
\item[-] Lua \href{dunno}{Telemetry Scripts}
|
||||
\item[-] Lua \href{dunno}{Script Reference} - detailed reference of OpenTX Lua implementation and interface
|
||||
\item[-] Lua \href{dunno}{Script Examples} - some example scripts with comments
|
||||
\end{itemize}
|
||||
|
||||
\subsubsection*{Examples of typical use of model scripts}
|
||||
|
||||
\begin{itemize}[leftmargin=*, itemsep=5mm,nolistsep]
|
||||
\item[-] replacement for complex mixes that are \textbf{not critical to model function}
|
||||
\item[-] complex processing of inputs and reaction to their current state and/or their history
|
||||
\item[-] filtering of telemetry values
|
||||
\item[-] automatic detection of number of battery cells and setting of low battery threshold
|
||||
\item[-] automatic announcing of maximum altitude for each DLG throw
|
||||
\item[-] see also Lua \href{dunno}{Script Examples}
|
||||
\end{itemize}
|
||||
|
||||
\subsection{Limitations of model scripts}
|
||||
\begin{itemize}[leftmargin=*,itemsep=5mm,nolistsep]
|
||||
\item[-] Should not display anything on LCD screen.
|
||||
\item[-] Can't wait for user input via dialog.
|
||||
\item[-] Should not exceed maximum allowed runtime/ number of instructions.
|
||||
\item[-] Standard OpenTX mixes are run every XX milliseconds in a very deterministic way (guaranteed execution) while model scripts are run from another thread with less priority. Their execution period is around 30ms and is not guaranteed!
|
||||
\item[-] A script could be disabled/killed anytime due to several causes like (error in script, not enough free memory, etc...)
|
||||
\end{itemize}
|
||||
|
||||
\subsection{Anatomy of model script}
|
||||
\subsubsection{Location of model script}
|
||||
\paragraph{}
|
||||
Place them on SD card in folder \texttt{SCRIPTS/MIXES}
|
||||
\subsubsection{Lifetime of model script}
|
||||
\paragraph{}
|
||||
\begin{itemize}[leftmargin=*,itemsep=5mm,nolistsep]
|
||||
\item[-] script is loaded from SD card when model is selected
|
||||
\item[-] script \textbf{init} function is called
|
||||
\item[-] script \textbf{run} function is periodically called (inside GUI thread, period cca 30ms)
|
||||
\item[-] script is stopped and disabled if it misbehaves (too long runtime, error in code, low memory)
|
||||
\item[-] all model scripts are stopped while one-time script is running (see \href{dunno}{Lua One-time scripts})
|
||||
\end{itemize}
|
||||
|
||||
\subsubsection{Script interface definitionn}
|
||||
\paragraph{}
|
||||
Every script must include a \textbf{return} statement at the end, that defines its interface to the rest of OpenTX code.
|
||||
|
||||
This statement defines:
|
||||
\begin{itemize}[leftmargin=*,itemsep=5mm,nolistsep]
|
||||
\item[-] script \textbf{inputs} (optional)
|
||||
\item[-] script \textbf{outputs} (optional)
|
||||
\item[-] script \textbf{init} function (optional)
|
||||
\item[-] script \textbf{run} function
|
||||
\end{itemize}
|
||||
|
||||
For example:
|
||||
\begin{lstlisting}[caption={A dummy Lua script}]
|
||||
-- script body would be here
|
||||
|
||||
return { input=inputs, output=outputs, run=run_func, init=init_func }
|
||||
\end{lstlisting}
|
||||
|
||||
This example defines :
|
||||
|
||||
\begin{itemize}[leftmargin=*,itemsep=5mm,nolistsep]
|
||||
\item[-] \texttt{inputs} table (array) as \textbf{input} values to model script
|
||||
\item[-] \texttt{outputs} table as \textbf{output} of model script
|
||||
\item[-] \texttt{run\_func()} as \textbf{periodic execution function} that takes inputs as parameters and returns outputs table
|
||||
\item[-] \texttt{init\_func()} as function that is \textbf{called one time} when script is loaded and begins execution.
|
||||
\end{itemize}
|
||||
\paragraph{}
|
||||
\begin{info}
|
||||
Parameters \textbf{init}, \textbf{input} and \textbf{output} are optional. \\ If model script doesn't use them, they can be omitted from return statement.
|
||||
\end{info}
|
||||
|
||||
\begin{lstlisting}[caption={Example without init and output}]
|
||||
local inputs = { { "Aileron", SOURCE }, { "Ail. ratio", VALUE, -100, 100, 0 } }
|
||||
|
||||
local function run_func(ail, ratio)
|
||||
-- do some stuff
|
||||
if (ail > 50) and ( ratio < 40) then
|
||||
playFile("foo.wav")
|
||||
end
|
||||
end
|
||||
|
||||
-- script that only uses input and run
|
||||
return { run=run_func, input=inputs }
|
||||
\end{lstlisting}
|
||||
|
||||
\newpage
|
||||
|
||||
\subsubsection{Script interface definition}
|
||||
\paragraph{}
|
||||
If defined, \textbf{init} function is called right after the script is loaded from SD card and begins execution. Init is called \textbf{only once} before the run function is called for the first time.
|
||||
|
||||
\begin{longtable}{p{3cm}p{3cm}p{\dimexpr\columnwidth-6cm-6\tabcolsep\relax}}
|
||||
\toprule
|
||||
\textbf{Prototype} & \multicolumn{2}{l} {\texttt{local <init\_function\_name>()}} \\
|
||||
\midrule
|
||||
\textbf{Parameters} & none & \\
|
||||
\midrule
|
||||
\textbf{Returns} & none & \\
|
||||
\bottomrule
|
||||
\end{longtable}
|
||||
|
||||
\subsubsection{Script execution}
|
||||
\paragraph{}
|
||||
The \textbf{run} function is the function that is periodically called for the entire lifetime of script. Syntax of run function is different between model scripts and one-time scripts.
|
||||
|
||||
\begin{longtable}{p{3cm}p{3cm}p{\dimexpr\columnwidth-6cm-6\tabcolsep\relax}}
|
||||
\toprule
|
||||
\textbf{Prototype} & \multicolumn{2}{l} {\texttt{local <run\_function\_name>([first input, [second input], ...])}} \\
|
||||
\midrule
|
||||
\textbf{Parameters} & <> & zero or more input values, their names are arbitrary, their meaning and order is defined by the input table \\
|
||||
\midrule
|
||||
\textbf{Returns} & none & if output table is empty (i.e. script has no output) \\
|
||||
& values & (comma separated list of values) list of output values, their order and meaning is defined by the output table \\
|
||||
\bottomrule
|
||||
\end{longtable}
|
||||
|
||||
\subsubsection{Macro Test}
|
||||
|
||||
\newcounter{parameters}
|
||||
\newcounter{returns}
|
||||
|
||||
\newenvironment{funcdef}[0]
|
||||
{\setcounter{parameters}{0}\setcounter{returns}{0}
|
||||
\newcommand{\prototype}[1]{\textbf{Prototype} & \multicolumn{2}{l} {\texttt{##1}}}
|
||||
\newcommand{\parameter}[2]{\ifthenelse{\value{parameters}=0}{\\\midrule\textbf{Parameters}}{\\}\stepcounter{parameters}& \texttt{##1} & ##2}
|
||||
\newcommand{\return}[2]{\ifthenelse{\value{returns}=0}{\\\midrule\textbf{Returns}}{\\}\stepcounter{returns}& ##1 & ##2}
|
||||
\begin{longtable}{p{3cm}p{3cm}p{\dimexpr\columnwidth-6cm-6\tabcolsep\relax}}
|
||||
\toprule}
|
||||
{\\\bottomrule
|
||||
\end{longtable}}
|
||||
|
||||
\begin{funcdef}
|
||||
\prototype{local <run\_function\_name>([first input, [second input], ...])}
|
||||
\parameter{<>}{zero or more input values, their names are arbitrary, their meaning and order is defined by the input table}
|
||||
\parameter{none}{test}
|
||||
\parameter{none}{test}
|
||||
\return{none}{[text...]}
|
||||
\return{none}{[text...]}
|
||||
\return{none}{[text...]}
|
||||
\return{none}
|
||||
\end{funcdef}
|
||||
|
||||
\begin{funcdef}
|
||||
\prototype{playNumber(number, unit, att)}
|
||||
\parameter{number}{(integer)}
|
||||
\parameter{unit}{(integer)}
|
||||
\parameter{att}{(integer)}
|
||||
\return{nil}
|
||||
\end{funcdef}
|
||||
|
||||
\end{document}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
/settings.sh
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# in this file define ssh options (like private key)
|
||||
source ~/.opentx-jenkins-settings
|
||||
|
||||
function download() {
|
||||
# $1 is release directory name
|
||||
mkdir -p ${1}
|
||||
scp ${SCP_OPT} ${USERNAME}@jenkins.open-tx.org:/home/opentx/${1}/*.sh ${1}/
|
||||
#chmod 774 ${1}/*.sh
|
||||
}
|
||||
|
||||
download release-20
|
||||
download nightly-21
|
||||
download release-21
|
||||
download nightly-22
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# stops on first error
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# make sure we are in the good directory
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
cd ${DIR}
|
||||
source ./version.sh
|
||||
|
||||
# release all components
|
||||
./release-companion.sh
|
||||
./release-firmware.sh
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# stops on first error
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# make sure we are in the good directory
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
cd ${DIR}
|
||||
|
||||
# pull the latest changes
|
||||
./update-repo.sh
|
||||
|
||||
# retrieve release after the repo update
|
||||
source ./version.sh
|
||||
|
||||
DESTDIR=/var/www/html/downloads-${version}/nightly/companion
|
||||
|
||||
# clean radio source
|
||||
cd opentx/radio/src
|
||||
make clean
|
||||
|
||||
# create companion rpm
|
||||
rm -rf ${DIR}/companion-build/
|
||||
mkdir -p ${DIR}/companion-build/
|
||||
cd ${DIR}/companion-build/
|
||||
cmake ../opentx/companion/src
|
||||
make package
|
||||
cp ./companion${version}-${release}${OPENTX_VERSION_SUFFIX}-i686.rpm ${DESTDIR}
|
||||
|
||||
make stamp
|
||||
chmod -Rf g+w . || true
|
||||
|
||||
# request companion compilation on Windows
|
||||
cd ${DESTDIR}
|
||||
wget -qO- http://winbox.open-tx.org/companion-builds/compile21.php?branch=${branch}\&suffix=${OPENTX_VERSION_SUFFIX}
|
||||
wget -O companion-windows-${release}${OPENTX_VERSION_SUFFIX}.exe http://winbox.open-tx.org/companion-builds/companion-windows-${release}${OPENTX_VERSION_SUFFIX}.exe
|
||||
mv ${DIR}/opentx/companion/companion.stamp ./companion-windows.stamp
|
||||
|
||||
chmod -Rf g+w . || true
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# stops on first error
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# make sure we are in the good directory
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
cd ${DIR}
|
||||
|
||||
# pull the latest changes
|
||||
./update-repo.sh
|
||||
|
||||
# retrieve release after the repo update
|
||||
source ./version.sh
|
||||
|
||||
# make the stamp
|
||||
cd opentx/radio/src
|
||||
make clean
|
||||
make opentx-stamp
|
||||
|
||||
# create the sources tgz in the release directory
|
||||
cd ../../..
|
||||
tar czf ./opentx.tgz opentx/radio/src opentx/radio/util
|
||||
|
||||
# make lua fields for all radio variants
|
||||
cd opentx/radio/src
|
||||
make lua_exports_taranis.inc lua_exports_taranis_x9e.inc
|
||||
|
||||
DESTDIR=/var/www/html/downloads-${version}/nightly/firmware
|
||||
|
||||
# copy the stamp and the release-notes to the http server
|
||||
cd ${DIR}
|
||||
cp opentx/radio/src/stamp-opentx.txt ${DESTDIR}
|
||||
cp opentx/radio/releasenotes.txt ${DESTDIR}
|
||||
cp opentx/radio/src/lua_fields_*.txt ${DESTDIR}
|
||||
echo ${OPENTX_VERSION_SUFFIX} > ${DESTDIR}/suffix.txt
|
||||
|
||||
# erase all previous builds
|
||||
rm -f ${DESTDIR}/binaries/opentx*.hex
|
||||
rm -f ${DESTDIR}/binaries/opentx*.bin
|
||||
|
||||
# clean the sources
|
||||
cd opentx/radio/src
|
||||
make clean
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# stops on first error
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# make sure we are in the good directory
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
cd $DIR
|
||||
source ./version.sh
|
||||
|
||||
# pull the latest changes
|
||||
cd opentx
|
||||
git fetch
|
||||
git checkout $branch
|
||||
git reset --hard origin/$branch
|
||||
chmod -Rf g+w . || true
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# make stamp header and extract OpenTX version (ie 2.1.2)
|
||||
make -C opentx/radio/src stamp_header
|
||||
rel=`grep "VERS_STR" opentx/radio/src/stamp-opentx.h | cut -d' ' -f3 | tr -d '"'`
|
||||
release=${rel%$OPENTX_VERSION_SUFFIX}
|
||||
echo ${release}
|
||||
|
||||
version=21
|
||||
branch=master
|
||||
winboxurl=http://winbox.open-tx.org/voice-builds
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# stops on first error
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# make sure we are in the good directory
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
cd ${DIR}
|
||||
source ./version.sh
|
||||
|
||||
# release all components
|
||||
./release-companion.sh
|
||||
./release-firmware.sh
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# stops on first error
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# make sure we are in the good directory
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
cd ${DIR}
|
||||
|
||||
# pull the latest changes
|
||||
./update-repo.sh
|
||||
|
||||
# retrieve release after the repo update
|
||||
source ./version.sh
|
||||
|
||||
DESTDIR=/var/www/html/downloads-${version}/nightlies/companion
|
||||
|
||||
# clean radio source
|
||||
cd opentx/radio/src
|
||||
make clean
|
||||
|
||||
# create companion rpm
|
||||
rm -rf ${DIR}/companion-build/
|
||||
mkdir -p $_
|
||||
cd $_
|
||||
cmake -DPCB=TARANIS ../opentx
|
||||
make package
|
||||
cp ./companion${version}-${release}${OPENTX_VERSION_SUFFIX}-i686.rpm ${DESTDIR}/linux
|
||||
chmod -Rf g+w ${DESTDIR}/linux/companion${version}-${release}${OPENTX_VERSION_SUFFIX}-i686.rpm
|
||||
|
||||
# request companion compilation on Windows
|
||||
cd ${DESTDIR}
|
||||
wget -qO- http://winbox.open-tx.org/companion-builds/compile22.php?branch=${branch}\&suffix=${OPENTX_VERSION_SUFFIX}
|
||||
wget -O windows/companion-windows-${release}${OPENTX_VERSION_SUFFIX}.exe http://winbox.open-tx.org/companion-builds/companion-windows-${release}${OPENTX_VERSION_SUFFIX}.exe
|
||||
chmod -Rf g+w windows/companion-windows-${release}${OPENTX_VERSION_SUFFIX}.exe
|
||||
|
||||
# update windows stamp
|
||||
cp $DIR/companion-build/version.h ./companion-windows.stamp
|
||||
chmod -Rf g+w ./companion-windows.stamp
|
||||
@@ -1,45 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# stops on first error
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# make sure we are in the good directory
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
cd ${DIR}
|
||||
|
||||
# pull the latest changes
|
||||
./update-repo.sh
|
||||
|
||||
# retrieve release after the repo update
|
||||
source ./version.sh
|
||||
|
||||
# make the stamp
|
||||
cd opentx/radio/src
|
||||
make clean
|
||||
make stamp.h
|
||||
|
||||
# create the sources tgz in the release directory
|
||||
cd ../../..
|
||||
tar czf ./opentx.tgz opentx/radio/src opentx/radio/util
|
||||
|
||||
# make lua fields for all radio variants
|
||||
cd opentx/radio/src
|
||||
make lua/lua_exports_taranis.inc lua/lua_exports_taranis_x9e.inc lua/lua_exports_horus.inc
|
||||
|
||||
DESTDIR=/var/www/html/downloads-${version}/nightlies/firmware
|
||||
|
||||
# copy the stamp and the release-notes to the http server
|
||||
cd $DIR
|
||||
cp opentx/radio/src/stamp.h ${DESTDIR}/stamp-opentx.txt
|
||||
cp opentx/radio/releasenotes.txt ${DESTDIR}
|
||||
cp opentx/radio/src/lua/lua_fields_*.txt ${DESTDIR}
|
||||
echo ${OPENTX_VERSION_SUFFIX} > ${DESTDIR}/suffix.txt
|
||||
|
||||
# erase all previous builds
|
||||
rm -f ${DESTDIR}/binaries/opentx*.hex
|
||||
rm -f ${DESTDIR}/binaries/opentx*.bin
|
||||
|
||||
# clean the sources
|
||||
cd opentx/radio/src
|
||||
make clean
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# stops on first error
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# make sure we are in the good directory
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
cd $DIR
|
||||
source ./version.sh
|
||||
|
||||
# pull the latest changes
|
||||
cd opentx
|
||||
git fetch
|
||||
git checkout $branch
|
||||
git reset --hard origin/$branch
|
||||
chmod -Rf g+w . || true
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# make stamp header and extract OpenTX version (ie 2.1.2)
|
||||
make -C opentx/radio/src stamp.h
|
||||
rel=`grep "VERSION" opentx/radio/src/stamp.h | cut -d' ' -f3 | tr -d '"'`
|
||||
release=${rel%$OPENTX_VERSION_SUFFIX}
|
||||
echo ${release}
|
||||
|
||||
version=22
|
||||
branch=next
|
||||
winboxurl=http://winbox.open-tx.org/voice-builds
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# stops on first error
|
||||
set -e
|
||||
|
||||
# make sure we are in the good directory
|
||||
cd ~opentx/release-20/
|
||||
|
||||
# release all components
|
||||
./release-companion.sh
|
||||
#./release-voices.sh
|
||||
#./release-lua.sh
|
||||
./release-firmware.sh
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# stops on first error
|
||||
set -e
|
||||
|
||||
# make sure we are in the good directory
|
||||
cd ~opentx/release-20/
|
||||
|
||||
# pull the latest changes
|
||||
./update-repo.sh
|
||||
|
||||
# retrieve the version number
|
||||
cd opentx/radio/src
|
||||
line=`grep "VERSION = " Makefile`
|
||||
version=`expr "$line" : 'VERSION = \([0-9]\..*\)'`
|
||||
|
||||
# create companion rpm
|
||||
rm -rf ~opentx/release-20/companion-build/
|
||||
mkdir -p $_
|
||||
cd $_
|
||||
cmake ../opentx/companion/src
|
||||
make package
|
||||
|
||||
cp ./companion-$version-i686.rpm /var/www/html/downloads-20/companion/
|
||||
make stamp
|
||||
chmod -Rf g+w . || true
|
||||
|
||||
# request companion compilation on Windows
|
||||
cd /var/www/html/downloads-20/companion/
|
||||
wget -qO- http://winbox.open-tx.org/companion-builds/compile20.php?branch=2.0
|
||||
wget -O companionInstall_$version.exe http://winbox.open-tx.org/companion-builds/companionInstall_$version.exe
|
||||
mv ~opentx/release-20/opentx/companion/companion.stamp ./companion-windows.stamp
|
||||
|
||||
chmod -Rf g+w . || true
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# stops on first error
|
||||
set -e
|
||||
|
||||
# make sure we are in the good directory
|
||||
cd ~opentx/release-20/
|
||||
|
||||
# pull the latest changes
|
||||
./update-repo.sh
|
||||
|
||||
# make the stamp
|
||||
cd opentx/radio/src
|
||||
make clean
|
||||
make opentx-stamp
|
||||
make lua_exports.cpp
|
||||
|
||||
# create the sources tgz in the release directory
|
||||
cd ../../..
|
||||
tar czf ./opentx.tgz opentx/radio/src opentx/radio/util
|
||||
|
||||
# copy the stamp and the release-notes to the http server
|
||||
cd ~opentx/release-20/
|
||||
cp opentx/radio/src/stamp-opentx.txt /var/www/html/downloads-20/firmware/
|
||||
cp opentx/radio/releasenotes.txt /var/www/html/downloads-20/firmware/
|
||||
cp opentx/radio/src/lua_fields.txt /var/www/html/downloads-20/firmware/
|
||||
|
||||
# erase all previous builds
|
||||
rm -f /var/www/html/downloads-20/firmware/binaries/opentx*.hex
|
||||
rm -f /var/www/html/downloads-20/firmware/binaries/opentx*.bin
|
||||
|
||||
# clean the sources
|
||||
cd opentx/radio/src
|
||||
make clean
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# stops on first error
|
||||
set -e
|
||||
|
||||
# make sure we are in the good directory
|
||||
cd ~opentx/release-20/
|
||||
|
||||
# pull the latest changes
|
||||
./update-repo.sh
|
||||
|
||||
# make the stamp
|
||||
cd opentx/radio/wizard/
|
||||
zip -r /var/www/html/lua-20/wizard.zip *.lua *.bmp
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# stops on first error
|
||||
set -e
|
||||
|
||||
# get voice packs
|
||||
wget -O /dev/null http://winbox.open-tx.org/voice-packs/compile.php
|
||||
cd /var/www/html/voices-20/opentx-taranis/en/
|
||||
wget -O english-irish-taranis.zip http://winbox.open-tx.org/voice-packs/english-irish-taranis.zip
|
||||
wget -O english-scottish-taranis.zip http://winbox.open-tx.org/voice-packs/english-scottish-taranis.zip
|
||||
wget -O english-american-taranis.zip http://winbox.open-tx.org/voice-packs/english-american-taranis.zip
|
||||
wget -O english-australian-taranis.zip http://winbox.open-tx.org/voice-packs/english-australian-taranis.zip
|
||||
# wget -O english-taranis.csv http://winbox.open-tx.org/voice-packs/english-irish-taranis.csv
|
||||
cd /var/www/html/voices-20/opentx-taranis/fr/
|
||||
wget -O french-taranis.zip http://winbox.open-tx.org/voice-packs/french-taranis.zip
|
||||
# wget -O french-taranis.csv http://winbox.open-tx.org/voice-packs/french-taranis.csv
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# stops on first error
|
||||
set -e
|
||||
|
||||
# make sure we are in the good directory
|
||||
cd ~opentx/release-20/
|
||||
|
||||
# pull the latest changes
|
||||
cd opentx
|
||||
git fetch
|
||||
git checkout 2.0
|
||||
git reset --hard origin/2.0
|
||||
chmod -Rf g+w . || true
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# stops on first error
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# make sure we are in the good directory
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
cd ${DIR}
|
||||
source ./version.sh
|
||||
|
||||
# release all components
|
||||
./release-companion.sh
|
||||
./release-voices.sh
|
||||
./release-lua.sh
|
||||
./release-firmware.sh
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# stops on first error
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# make sure we are in the good directory
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
cd ${DIR}
|
||||
|
||||
# pull the latest changes
|
||||
./update-repo.sh
|
||||
|
||||
# retrieve release after the repo update
|
||||
source ./version.sh
|
||||
|
||||
DESTDIR=/var/www/html/downloads-${version}/companion
|
||||
|
||||
# clean radio source
|
||||
cd opentx/radio/src
|
||||
make clean
|
||||
|
||||
# create companion rpm
|
||||
rm -rf ${DIR}/companion-build/
|
||||
mkdir -p ${DIR}/companion-build/
|
||||
cd ${DIR}/companion-build/
|
||||
cmake ../opentx/companion/src
|
||||
make package
|
||||
cp ./companion${version}-${release}-i686.rpm ${DESTDIR}
|
||||
make stamp
|
||||
chmod -Rf g+w . || true
|
||||
|
||||
# request companion compilation on Windows
|
||||
cd ${DESTDIR}
|
||||
wget -qO- http://winbox.open-tx.org/companion-builds/compile21.php?branch=${branch}
|
||||
wget -O companion-windows-${release}.exe http://winbox.open-tx.org/companion-builds/companion-windows-${release}.exe
|
||||
mv ${DIR}/opentx/companion/companion.stamp ./companion-windows.stamp
|
||||
|
||||
chmod -Rf g+w . || true
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# stops on first error
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# make sure we are in the good directory
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
cd $DIR
|
||||
|
||||
# pull the latest changes
|
||||
./update-repo.sh
|
||||
|
||||
# retrieve release after the repo update
|
||||
source ./version.sh
|
||||
|
||||
# make the stamp
|
||||
cd opentx/radio/src
|
||||
make clean
|
||||
make opentx-stamp
|
||||
|
||||
# create the sources tgz in the release directory
|
||||
cd ../../..
|
||||
tar czf ./opentx.tgz opentx/radio/src opentx/radio/util
|
||||
|
||||
# make lua fields for all radio variants
|
||||
cd opentx/radio/src
|
||||
make lua_exports_taranis.inc lua_exports_taranis_x9e.inc
|
||||
|
||||
DESTDIR=/var/www/html/downloads-${version}/firmware
|
||||
|
||||
# copy the stamp and the release-notes to the http server
|
||||
cd ${DIR}
|
||||
cp opentx/radio/src/stamp-opentx.txt ${DESTDIR}
|
||||
cp opentx/radio/releasenotes.txt ${DESTDIR}
|
||||
cp opentx/radio/src/lua_fields_*.txt ${DESTDIR}
|
||||
|
||||
# erase all previous builds
|
||||
rm -f ${DESTDIR}/binaries/opentx*.hex
|
||||
rm -f ${DESTDIR}/binaries/opentx*.bin
|
||||
|
||||
# clean the sources
|
||||
cd opentx/radio/src
|
||||
make clean
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# stops on first error
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# make sure we are in the good directory
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
cd ${DIR}
|
||||
|
||||
# pull the latest changes
|
||||
./update-repo.sh
|
||||
|
||||
# retrieve release after the repo update
|
||||
source ./version.sh
|
||||
|
||||
# release wizard
|
||||
cd opentx/radio/wizard/
|
||||
zip -r /var/www/html/lua-${version}/wizard.zip *.lua *.bmp
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# stops on first error
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# make sure we are in the good directory
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
cd ${DIR}
|
||||
|
||||
# retrieve release after the repo update
|
||||
source ./version.sh
|
||||
|
||||
# build voice packs
|
||||
wget -O /dev/null ${winboxurl}/compile.php?branch=${branch}
|
||||
|
||||
# get voice packs
|
||||
cd /var/www/html/voices-${version}/opentx-taranis/en/
|
||||
wget -O english-irish-taranis.zip ${winboxurl}/english-irish-taranis.zip
|
||||
wget -O english-scottish-taranis.zip ${winboxurl}/english-scottish-taranis.zip
|
||||
wget -O english-american-taranis.zip ${winboxurl}/english-american-taranis.zip
|
||||
wget -O english-australian-taranis.zip ${winboxurl}/english-australian-taranis.zip
|
||||
# wget -O english-taranis.csv ${winboxurl}/english-irish-taranis.csv # doesn't seem to work
|
||||
|
||||
cd /var/www/html/voices-${version}/opentx-taranis/fr/
|
||||
wget -O french-taranis.zip ${winboxurl}/french-taranis.zip
|
||||
# wget -O french-taranis.csv ${winboxurl}/french-taranis.csv #outdated
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# stops on first error
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# make sure we are in the good directory
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
cd $DIR
|
||||
source ./version.sh
|
||||
|
||||
# pull the latest changes
|
||||
cd opentx
|
||||
git fetch
|
||||
git checkout $branch
|
||||
git reset --hard origin/$branch
|
||||
chmod -Rf g+w . || true
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# make stamp header and extract OpenTX version (ie 2.1.2)
|
||||
make -C opentx/radio/src stamp_header
|
||||
rel=`grep "VERS_STR" opentx/radio/src/stamp-opentx.h | cut -d' ' -f3 | tr -d '"'`
|
||||
release=${rel%$OPENTX_VERSION_SUFFIX}
|
||||
echo ${release}
|
||||
|
||||
version=21
|
||||
branch=master
|
||||
winboxurl=http://winbox.open-tx.org/voice-builds
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# in this file define ssh options (like private key)
|
||||
source ~/.opentx-jenkins-settings
|
||||
|
||||
function upload() {
|
||||
# $1 is release directory name
|
||||
# copy scripts to server
|
||||
scp ${SCP_OPT} ${1}/*.sh ${USERNAME}@jenkins.open-tx.org:/home/opentx/${1}/
|
||||
}
|
||||
|
||||
upload release-20
|
||||
upload nightly-21
|
||||
upload release-21
|
||||
upload nightly-22
|
||||
@@ -1,12 +0,0 @@
|
||||
opentx-companion22 (2.2.1~ppa01~artful) artful; urgency=low
|
||||
|
||||
* New release 2.2.1~ppa01
|
||||
|
||||
-- projectkk2glider <projectkk2glider@gmail.com> Sun, 17 Dec 2017 17:32:37 +0100
|
||||
|
||||
opentx-companion22 (2.2.1~N432+test01~artful) artful; urgency=low
|
||||
|
||||
* New release 2.2.1~N432+test01
|
||||
|
||||
-- projectkk2glider <projectkk2glider@gmail.com> Fri, 10 Nov 2017 18:36:11 +0100
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
opentx-companion22 (2.2.1~ppa01~bionic) bionic; urgency=low
|
||||
|
||||
* New release 2.2.1~ppa01
|
||||
|
||||
-- projectkk2glider <projectkk2glider@gmail.com> Sun, 17 Dec 2017 17:32:37 +0100
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
/suffix
|
||||
@@ -1,21 +0,0 @@
|
||||
Source: opentx-companion22
|
||||
Section: utils
|
||||
Priority: optional
|
||||
Maintainer: projectkk2glider <projectkk2glider@gmail.com>
|
||||
Build-Depends: cmake,
|
||||
build-essential,
|
||||
python,
|
||||
python-qt4,
|
||||
qt5-default,
|
||||
qttools5-dev-tools,
|
||||
qtmultimedia5-dev,
|
||||
qttools5-dev,
|
||||
libsdl1.2-dev,
|
||||
libqt5svg5-dev
|
||||
Homepage: http://www.open-tx.org/
|
||||
|
||||
Package: opentx-companion22
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, libqt5multimedia5-plugins
|
||||
Description: OpenTX Companion
|
||||
Models and settings editor for the OpenTX open source firmware
|
||||
@@ -1,339 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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
|
||||
(at your option) any later version.
|
||||
|
||||
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.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
@@ -1,50 +0,0 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
BUILDDIR = build_dir
|
||||
COMMON_OPTIONS = -DCMAKE_INSTALL_PREFIX=../debian/tmp/usr \
|
||||
-DSIMULATOR_INSTALL_PREFIX=/usr \
|
||||
-DFIRMWARE_TARGET=NO \
|
||||
-DGVARS=YES \
|
||||
-DHELI=YES \
|
||||
-DALLOW_NIGHTLY_BUILDS=NO \
|
||||
-DVERSION_SUFFIX=__VERSION_SUFFIX__
|
||||
|
||||
STM32_OPTIONS = -DLUA=YES
|
||||
|
||||
# secondly called by launchpad
|
||||
build:
|
||||
mkdir $(BUILDDIR);
|
||||
|
||||
cd $(BUILDDIR); cmake $(COMMON_OPTIONS) -DPCB=SKY9X ../ ; make libsimulator
|
||||
cd $(BUILDDIR); cmake $(COMMON_OPTIONS) -DPCB=9XRPRO ../ ; make libsimulator
|
||||
|
||||
cd $(BUILDDIR); cmake $(COMMON_OPTIONS) $(STM32_OPTIONS) -DPCB=X7 ../ ; make libsimulator
|
||||
cd $(BUILDDIR); cmake $(COMMON_OPTIONS) $(STM32_OPTIONS) -DPCB=X9D ../ ; make libsimulator
|
||||
cd $(BUILDDIR); cmake $(COMMON_OPTIONS) $(STM32_OPTIONS) -DPCB=X9D+ ../ ; make libsimulator
|
||||
cd $(BUILDDIR); cmake $(COMMON_OPTIONS) $(STM32_OPTIONS) -DPCB=X9E ../ ; make libsimulator
|
||||
cd $(BUILDDIR); cmake $(COMMON_OPTIONS) $(STM32_OPTIONS) -DPCB=X12S ../ ; make libsimulator
|
||||
cd $(BUILDDIR); cmake $(COMMON_OPTIONS) $(STM32_OPTIONS) -DPCB=JUMPERT12 ../ ; make libsimulator
|
||||
cd $(BUILDDIR); cmake $(COMMON_OPTIONS) $(STM32_OPTIONS) -DPCB=JUMPERT16 ../ ; make libsimulator
|
||||
|
||||
make -C $(BUILDDIR) companion22 simulator22
|
||||
|
||||
# thirdly called by launchpad
|
||||
binary: binary-indep binary-arch
|
||||
|
||||
binary-indep:
|
||||
# nothing to be done
|
||||
|
||||
binary-arch:
|
||||
# final cmake neede in order to find all simulators
|
||||
cd $(BUILDDIR); cmake ../
|
||||
cd $(BUILDDIR); cmake -P cmake_install.cmake
|
||||
mkdir debian/tmp/DEBIAN
|
||||
dpkg-shlibdeps debian/tmp/usr/bin/companion22 debian/tmp/usr/bin/simulator22 debian/tmp/usr/lib/companion22/*
|
||||
dpkg-gencontrol -popentx-companion22
|
||||
dpkg --build debian/tmp ..
|
||||
|
||||
# firstly called by launchpad
|
||||
clean:
|
||||
rm -rf $(BUILDDIR)
|
||||
|
||||
.PHONY: binary binary-arch binary-indep clean
|
||||
@@ -1,72 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# $1 is distribution "trusty" OR "yakkety"
|
||||
#
|
||||
# Option "-n" or "--nightly" can be used to configure build script to produce a Companion with DALLOW_NIGHTLY_BUILDS=YES flag
|
||||
|
||||
|
||||
cd `dirname ${0}`
|
||||
|
||||
nightly_build=0
|
||||
|
||||
while [ $# -gt 0 ]
|
||||
do
|
||||
case "$1" in
|
||||
--nightly*)
|
||||
nightly_build=1;;
|
||||
-n*)
|
||||
nightly_build=1;;
|
||||
-*)
|
||||
echo >&2 "usage: $0 [-n|--nightly] DISTRO"
|
||||
exit 1;;
|
||||
*)
|
||||
break;; # terminate while loop
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
|
||||
distro=${1%/}
|
||||
|
||||
. common/suffix
|
||||
|
||||
if [ -z ${distro} ] ; then
|
||||
echo "Missing distribution name"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d ${distro} ] ; then
|
||||
echo "Files for ${distro} not found. Most likely unsupported distribution. Aborting..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Preparing sources for ${distro}..."
|
||||
|
||||
# prepare debian directory
|
||||
rm -f ../debian/*
|
||||
mkdir -p ../debian/
|
||||
cp common/* ../debian/
|
||||
cp ${distro}/* ../debian/
|
||||
|
||||
|
||||
if [ ${nightly_build} -gt 0 ] ; then
|
||||
echo "Editing rules to set version suffix to \"${suffix}\""
|
||||
sed -i "s/__VERSION_SUFFIX__/${suffix}/g" ../debian/rules
|
||||
echo "Setting nightly build flag"
|
||||
sed -i "s/DALLOW_NIGHTLY_BUILDS=YES/DALLOW_NIGHTLY_BUILDS=YES/g" ../debian/rules
|
||||
else
|
||||
sed -i "s/__VERSION_SUFFIX__//g" ../debian/rules
|
||||
sed -i "s/DALLOW_NIGHTLY_BUILDS=YES/DALLOW_NIGHTLY_BUILDS=NO/g" ../debian/rules
|
||||
fi
|
||||
|
||||
# remove old package and prepare new one
|
||||
cd ..
|
||||
rm -f ../opentx-companion22_*${distro}*
|
||||
debuild -S -sa -I -Ijenkins -Ilaunchpad -Idoc -Ibuild -I*.luac
|
||||
|
||||
echo "Use this command to upload to launchpad (nightly builds):"
|
||||
echo " dput ppa:opentx-test/ppa opentx-companion22_<version>.changes"
|
||||
echo "OR releases:"
|
||||
echo " dput ppa:opentx-test/rel opentx-companion22_<version>.changes"
|
||||
@@ -1,108 +0,0 @@
|
||||
# Launchpad instructions
|
||||
|
||||
## General description
|
||||
|
||||
This directory contains files and scripts that help to prepare the files needed by the Launchpad.net server to build the Debian packages of OpentX Companion for Ubuntu.
|
||||
|
||||
Each supported release of Ubuntu has its own sub-directory, but most of the files reside in the common directory. When preparing a source for certain Ubuntu release always use its the directory name.
|
||||
|
||||
There are several step to release a new version of Companion on Launchpad:
|
||||
* update the Debian changelog
|
||||
* package the source
|
||||
* upload the source to Launchpad
|
||||
|
||||
The steps above should be repeated for every Ubuntu release. The example below will work with Ubuntu `trusty`
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* you must have launchpad.net account and be a member of the team
|
||||
* create and configure your GPG signing key
|
||||
|
||||
## Prepare your GPG key
|
||||
|
||||
Create GPG key using **name** and **email* that will later appear in the changelog. This will be the key
|
||||
that will be used to sign the package before uploading it to Launchpad.
|
||||
```
|
||||
gpg --gen-key
|
||||
```
|
||||
|
||||
Upload your GPG key (public part) to the Ubuntu key-server. First get the KEY ID (8 characters) of your key:
|
||||
```
|
||||
gpg --list-keys
|
||||
```
|
||||
|
||||
Then upload it (replace <KEY ID> with your key ID):
|
||||
```
|
||||
gpg --send-keys --keyserver keyserver.ubuntu.com <KEY ID>
|
||||
```
|
||||
|
||||
## Create a Launchpad account
|
||||
* Go to https://launchpad.net/ and sign-in or register.
|
||||
* Associate your GPG key with your launchpad account. You will need your keys fingerprint (<fingerprint looks like E448 37D6 EF6E F13C 30C0 415C E7A0 818F 4864 9459>), get it with:
|
||||
```
|
||||
gpg --fingerprint
|
||||
```
|
||||
* Join OpenTX team on launchpad (one of admins will add you to the team).
|
||||
|
||||
|
||||
## Step 1: update the Debian changelog
|
||||
|
||||
You can edit changelog manually, but it is simpler to use a script that creates a generic entry in the changelog. You can always edit it later if needed.
|
||||
|
||||
The script is `update-changelog.sh` and it takes 4 parameters:
|
||||
* email address in the form of `name <email@address>`, since it contains a space it must be enclosed in quotation marks. The email addres must be the same as the one in your GPG key!
|
||||
* Ubuntu release (directory name)
|
||||
* OpenTX version
|
||||
* OpenTX sub-version (Nxxx for nightly builds)
|
||||
|
||||
Example:
|
||||
```
|
||||
cd opentx/launchpad
|
||||
./update-changelog.sh "projectkk2glider <projectkk2glider@gmail.com>" trusty 2.2.0 N363
|
||||
```
|
||||
|
||||
If there is an error and you need to build another version of the same OpenTX release, then just add `.n` to the sub-version like so:
|
||||
```
|
||||
N363.1
|
||||
N363.2
|
||||
etc
|
||||
```
|
||||
|
||||
The script will append new section to the existing file in this case `trusty/changelog`. Now you have a chance to edit the file manually if needed.
|
||||
|
||||
## Step 2: prepare files for upload (package the source)
|
||||
|
||||
First make sure you don't have any files that you don't want included in the opentx directory. Then use the script `prepare.sh` with the name of release as the first parameter:
|
||||
|
||||
```
|
||||
cd opentx/launchpad
|
||||
./prepare.sh trusty
|
||||
```
|
||||
|
||||
The result of this script are three files which are placed outside the OpenTX source tree at the same level as `opentx` directory:
|
||||
```
|
||||
ls -1 ../../opentx-companion22_2.2.0~N363*
|
||||
../../opentx-companion22_2.2.0~N363~trusty.dsc
|
||||
../../opentx-companion22_2.2.0~N363~trusty_source.build
|
||||
../../opentx-companion22_2.2.0~N363~trusty_source.changes
|
||||
../../opentx-companion22_2.2.0~N363~trusty.tar.gz
|
||||
```
|
||||
|
||||
You should now make sure that the just build source archive `opentx-companion22_2.2.0~N363~trusty.tar.gz` does not contain any files or directories that you don;t want to share with the world, because this is one of the files that will be uploaded to the Launchpad server. Currently clean OpenTX tree produces this file with approximate size of 16.8MB.
|
||||
|
||||
## Upload the source to the Launchpad
|
||||
|
||||
Last step it to upload the new release to the Launchpad server and wait for it to be built. Use `dput` command with two arguments:
|
||||
* name of the PPA `ppa:opentx-test/ppa` (your public key must be associated with that PPA)
|
||||
* name of the release file `<dsfsfggg>.changes`
|
||||
|
||||
Upload to nightly PPA:
|
||||
```
|
||||
dput ppa:opentx-test/ppa ../../opentx-companion22_2.2.0~N363~trusty_source.changes
|
||||
```
|
||||
|
||||
Upload to release PPA:
|
||||
```
|
||||
dput ppa:opentx-test/rel ../../opentx-companion22_2.2.0~N363~trusty_source.changes
|
||||
```
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# $1 is changelog user and email, example "projectkk2glider <projectkk2glider@gmail.com>"
|
||||
# $2 is distribution "trusty" OR "yakkety"
|
||||
# $3 is version, example "2.2.1"
|
||||
# $4 is suffix (optional, used for nightly builds, example "N360")
|
||||
|
||||
email=${1}
|
||||
distro=${2%/}
|
||||
version=${3}
|
||||
suffix=${4}
|
||||
|
||||
echo "Updating changelog for ${distro}"
|
||||
|
||||
cd `dirname ${0}`
|
||||
|
||||
[ -z ${distro} ] && echo "Missing distribution name" && exit 1;
|
||||
[ ! -z ${suffix} ] && version=${version}~${suffix}
|
||||
|
||||
if [ ! -d ${distro} ] ; then
|
||||
echo "${distro} changelog not found. Most likely unsupported distribution. Aborting..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "opentx-companion22 (${version}~${distro}) ${distro}; urgency=low" > tmp-changelog
|
||||
echo "" >> tmp-changelog
|
||||
echo " * New release ${version}" >> tmp-changelog
|
||||
echo "" >> tmp-changelog
|
||||
echo " -- ${email} "`date -R` >> tmp-changelog
|
||||
echo "" >> tmp-changelog
|
||||
|
||||
cat tmp-changelog ${distro}/changelog > new-changelog
|
||||
mv new-changelog ${distro}/changelog
|
||||
rm tmp-changelog
|
||||
|
||||
echo "suffix=${suffix}" > common/suffix
|
||||
|
||||
echo "Result:"
|
||||
cat ${distro}/changelog | head -n 20
|
||||
@@ -1,23 +0,0 @@
|
||||
opentx-companion22 (2.2.1~ppa01~xenial) xenial; urgency=low
|
||||
|
||||
* New release 2.2.1~ppa01
|
||||
|
||||
-- projectkk2glider <projectkk2glider@gmail.com> Sun, 17 Dec 2017 17:32:44 +0100
|
||||
|
||||
opentx-companion22 (2.2.1~N432+test01~xenial) xenial; urgency=low
|
||||
|
||||
* New release 2.2.1~N432+test01
|
||||
|
||||
-- projectkk2glider <projectkk2glider@gmail.com> Fri, 10 Nov 2017 18:55:08 +0100
|
||||
|
||||
opentx-companion22 (2.2.0~ppa02~xenial) xenial; urgency=low
|
||||
|
||||
* New release 2.2.0~ppa02
|
||||
|
||||
-- projectkk2glider <projectkk2glider@gmail.com> Wed, 31 May 2017 22:37:54 +0200
|
||||
|
||||
opentx-companion22 (2.2.0~ppa01~xenial) xenial; urgency=low
|
||||
|
||||
* OpenTX version 2.2.0
|
||||
|
||||
-- projectkk2glider <projectkk2glider@gmail.com> Wed, 31 May 2017 21:50:57 +0200
|
||||
@@ -1,12 +0,0 @@
|
||||
opentx-companion22 (2.2.1~ppa01~zesty) zesty; urgency=low
|
||||
|
||||
* New release 2.2.1~ppa01
|
||||
|
||||
-- projectkk2glider <projectkk2glider@gmail.com> Sun, 17 Dec 2017 17:32:48 +0100
|
||||
|
||||
opentx-companion22 (2.2.1~N432+test01~zesty) zesty; urgency=low
|
||||
|
||||
* New release 2.2.1~N432+test01
|
||||
|
||||
-- projectkk2glider <projectkk2glider@gmail.com> Fri, 10 Nov 2017 18:37:33 +0100
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
*.suo
|
||||
@@ -1,26 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual C# Express 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTXRecorder", "recorder\OpenTXRecorder.csproj", "{8143D08D-1861-42DD-A861-56B15DE42A69}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTXspeaker", "speaker\OpenTXspeaker.csproj", "{BB2C7ECA-B4B9-4957-B7D9-B0C7817CA148}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{8143D08D-1861-42DD-A861-56B15DE42A69}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{8143D08D-1861-42DD-A861-56B15DE42A69}.Debug|x86.Build.0 = Debug|x86
|
||||
{8143D08D-1861-42DD-A861-56B15DE42A69}.Release|x86.ActiveCfg = Release|x86
|
||||
{8143D08D-1861-42DD-A861-56B15DE42A69}.Release|x86.Build.0 = Release|x86
|
||||
{BB2C7ECA-B4B9-4957-B7D9-B0C7817CA148}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{BB2C7ECA-B4B9-4957-B7D9-B0C7817CA148}.Debug|x86.Build.0 = Debug|x86
|
||||
{BB2C7ECA-B4B9-4957-B7D9-B0C7817CA148}.Release|x86.ActiveCfg = Release|x86
|
||||
{BB2C7ECA-B4B9-4957-B7D9-B0C7817CA148}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,4 +0,0 @@
|
||||
/OpenTXrecorder.suo
|
||||
/bin/*
|
||||
/obj/*
|
||||
*.csproj.user
|
||||
@@ -1,8 +0,0 @@
|
||||
<Application x:Class="OpenTXrecorder.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
@@ -1,32 +0,0 @@
|
||||
/* This file is part of OpenTX Recorder.
|
||||
* OpenTX Recorder 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* OpenTX Recorder 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.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with OpenTX Recorder. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Copyright 2014 Kjell Kernen */
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
|
||||
namespace OpenTXrecorder
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 2.6 KiB |
@@ -1,136 +0,0 @@
|
||||
|
||||
<Window x:Class="OpenTXrecorder.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="OpenTX Recorder"
|
||||
Height="440"
|
||||
MinWidth="840"
|
||||
MaxWidth="840"
|
||||
ResizeMode="CanResizeWithGrip" SizeToContent="Width" Icon="/OpenTXrecorder;component/icon.ico" MinHeight="450">
|
||||
|
||||
|
||||
<Window.Resources>
|
||||
<DataTemplate x:Key="imagePlay">
|
||||
<Image x:Name="ThePlayImage" />
|
||||
<DataTemplate.Triggers>
|
||||
<DataTrigger Binding="{Binding Path=fileExists}" Value="true">
|
||||
<Setter TargetName="ThePlayImage" Property="Source" Value="/OpenTXrecorder;component/play.png" />
|
||||
</DataTrigger>
|
||||
</DataTemplate.Triggers>
|
||||
</DataTemplate>
|
||||
</Window.Resources>
|
||||
|
||||
<Grid VerticalAlignment="Stretch" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid Grid.Row="0" Grid.Column="0" VerticalAlignment="Stretch">
|
||||
|
||||
<ListView Name="lvSentences"
|
||||
SelectionMode="Single"
|
||||
MouseDoubleClick="play"
|
||||
VerticalAlignment="Stretch"
|
||||
ItemsSource="{Binding sentences, Mode=TwoWay}"
|
||||
IsSynchronizedWithCurrentItem="True"
|
||||
>
|
||||
<ListView.View>
|
||||
<GridView>
|
||||
<GridView.Columns>
|
||||
<GridViewColumn Header="File Name" Width="90" DisplayMemberBinding="{Binding fileName}" />
|
||||
<GridViewColumn Header="Description" Width="190" DisplayMemberBinding="{Binding description}" />
|
||||
<GridViewColumn Header="Voice" Width="190" DisplayMemberBinding="{Binding voiceString}" />
|
||||
<GridViewColumn Width="30" CellTemplate="{StaticResource imagePlay}" />
|
||||
</GridView.Columns>
|
||||
</GridView>
|
||||
</ListView.View>
|
||||
</ListView>
|
||||
</Grid>
|
||||
|
||||
<StackPanel Grid.Row="0" Grid.Column="1">
|
||||
<TextBlock Text="Settings" Margin="5,0,0,0" FontSize="18" />
|
||||
|
||||
<StackPanel Orientation="Vertical" HorizontalAlignment="Left" Margin="10,0,0,0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label Content="Language" Width="75" />
|
||||
<ComboBox Name="cbLanguages"
|
||||
DisplayMemberPath="lName"
|
||||
SelectedValuePath="sName"
|
||||
SelectionChanged="switchLanguage"
|
||||
Width="200" Height="23"
|
||||
ItemsSource="{Binding languages, Mode=TwoWay}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<Separator Height="5" />
|
||||
<TextBlock Text="Sentence" Margin="5,0,0,0" FontSize="18" />
|
||||
<Grid Margin="10,0,0,0" DataContext="{Binding ElementName=lvSentences, Path=SelectedItem}" Width="Auto">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="75" />
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="File Name" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="0" Margin="0,5,0,0" />
|
||||
<TextBox Text="{Binding Path=fileName}" Grid.Row="0" Grid.Column="1" Margin=" 0,0,10,0" />
|
||||
<TextBlock Text="Description" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="1" Grid.Column="0" Margin="0,5,0,0" />
|
||||
<TextBox Text="{Binding Path=description}" Grid.Row="1" Grid.Column="1" Margin=" 0,0,10,0"/>
|
||||
<TextBlock Text="Sentence" Grid.Row="2" Grid.Column="0" Margin="0,5,0,0" />
|
||||
<TextBox Text="{Binding Path=voiceString}" Grid.Row="2" Grid.Column="1" Margin="0,0,10,0"/>
|
||||
</Grid>
|
||||
<Separator Height="5" Margin="0,5,0,0" />
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,0">
|
||||
<TextBlock Text="Speed Up" Width="70" Margin="10,10,0,0" />
|
||||
<Slider Name="speedSlider"
|
||||
Value="0"
|
||||
Minimum="0"
|
||||
Maximum="17"
|
||||
TickPlacement="BottomRight"
|
||||
TickFrequency="1"
|
||||
IsSnapToTickEnabled="True"
|
||||
Width="170"
|
||||
Margin="10,10,10,0" ToolTip="Increase speech speed" />
|
||||
<TextBlock Text="{Binding ElementName=speedSlider, Path=Value}" Width="40" Margin="0,10,0,0"/>
|
||||
<TextBlock Text="Voice Rate" Width="70" Margin="10,10,0,0" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,0">
|
||||
<TextBlock Text="Cut Level" Width="70" Margin="10,10,0,0" />
|
||||
<Slider Name="noiceLevelSlider"
|
||||
Value="800"
|
||||
Minimum="0"
|
||||
Maximum="4000"
|
||||
TickPlacement="BottomRight"
|
||||
TickFrequency="100"
|
||||
IsSnapToTickEnabled="True"
|
||||
Width="170"
|
||||
Margin="10,10,10,0" ToolTip="Set Cut Level as low as possible" />
|
||||
<TextBlock Text="{Binding ElementName=noiceLevelSlider, Path=Value}" Width="40" Margin="0,10,0,0"/>
|
||||
<TextBlock Text="Voice Rate" Width="70" Margin="10,10,0,0" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,5,0,0">
|
||||
<Button Content="New Sentence" Width="120" Height="32" Name="buttonAddItem" Click="addSentence"/>
|
||||
<Button Name="btnRecord" ToolTip="Start recording" Click="record" Margin="20,0,0,0" >
|
||||
<Image Height="32" Source="/OpenTXrecorder;component/record.png"/>
|
||||
</Button>
|
||||
<Button Name="btnStop" ToolTip="Stop recording" Click="stop" Margin="5,0,0,0" >
|
||||
<Image Height="32" Source="/OpenTXrecorder;component/stop.png" />
|
||||
</Button>
|
||||
<Button Name="btnPlay" ToolTip="Play Sentence" Click="play" Margin="30,0,0,0" >
|
||||
<Image Height="32" Source="/OpenTXrecorder;component/play.png" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<Separator Height="5" />
|
||||
<Label Content="RECORDING" Name="lblRecording" HorizontalAlignment="Center" Foreground="Red" FontSize="24" FontWeight="Black" Visibility="Hidden" />
|
||||
</StackPanel>
|
||||
<Image Grid.Row="0" Grid.Column="1" Name="openTXLogo" Height="48" MouseLeftButtonDown="about" HorizontalAlignment="Right" Cursor="Hand" Margin="0,0,0,0" Source="/OpenTXrecorder;component/recorder_logo.png" Stretch="Uniform" VerticalAlignment="Bottom" />
|
||||
|
||||
</Grid>
|
||||
|
||||
</Window>
|
||||
@@ -1,305 +0,0 @@
|
||||
/* This file is part of OpenTX Recorder.
|
||||
* OpenTX Recorder 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* OpenTX Recorder 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.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with OpenTX Recorder. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Copyright 2014 Kjell Kernen */
|
||||
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Media;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Navigation;
|
||||
using System.Runtime.InteropServices;
|
||||
using WaveLib;
|
||||
using System.Net;
|
||||
|
||||
|
||||
namespace OpenTXrecorder
|
||||
{
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
Environment env;
|
||||
SentenceTables tables = new SentenceTables();
|
||||
public Sentences sentences { get; set; }
|
||||
public Languages languages { get; set; }
|
||||
|
||||
WavFileWriter filewriter;
|
||||
WaveInRecorder recorder;
|
||||
byte[] recordingBuffer;
|
||||
static int recSamplerate = 16000; // 8000, 16000 or 32000
|
||||
static int recBits = 16; // 8 or 16
|
||||
static int recChannels = 1; // 1 or 2
|
||||
static int recBuffersize = 1024 * 2;
|
||||
public bool isRecording { get; set; }
|
||||
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
this.DataContext = this;
|
||||
sentences = new Sentences();
|
||||
languages = new Languages();
|
||||
recordingBuffer = new byte[recBuffersize];
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
// Start by displaying Splash Screen
|
||||
SplashScreen splash = new SplashScreen("recorder_logo.png");
|
||||
splash.Show(true);
|
||||
Thread.Sleep(1500);
|
||||
|
||||
languages.Add("English", "en");
|
||||
languages.Add("Czech", "cz");
|
||||
languages.Add("German", "de");
|
||||
languages.Add("French", "fr");
|
||||
languages.Add("Italian", "it");
|
||||
languages.Add("Polish", "pl");
|
||||
languages.Add("Portuguese", "pt");
|
||||
languages.Add("Swedish", "se");
|
||||
languages.Add("Slovak", "sk");
|
||||
languages.Add("Spanish", "es");
|
||||
|
||||
env = new Environment(languages[0]);
|
||||
|
||||
cbLanguages.SelectedIndex = 0; // Note: Sets current langugage -> triggers loadlanguage()
|
||||
}
|
||||
|
||||
private void loadLanguage()
|
||||
{
|
||||
string[] system_strings;
|
||||
string[] other_strings;
|
||||
|
||||
try
|
||||
{
|
||||
system_strings = System.IO.File.ReadAllLines(env.systemSounds);
|
||||
other_strings = System.IO.File.ReadAllLines(env.otherSounds);
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
system_strings = tables.default_system_strings[tables.toInt(env.lang.sName)];
|
||||
other_strings = tables.default_other_strings[tables.toInt(env.lang.sName)];
|
||||
}
|
||||
sentences.Clear();
|
||||
|
||||
foreach (string str in system_strings)
|
||||
sentences.Add(str, env.sysDir);
|
||||
|
||||
sentences.Add(@";^ System Sounds ^;", "");
|
||||
|
||||
foreach (string str in other_strings)
|
||||
sentences.Add(str, env.baseDir);
|
||||
}
|
||||
|
||||
private void saveLanguage()
|
||||
{
|
||||
System.IO.Directory.CreateDirectory(env.sysDir);
|
||||
StreamWriter sw = File.CreateText(env.systemSounds);
|
||||
int i;
|
||||
for (i = 0; sentences[i].fileName != ""; i++)
|
||||
{
|
||||
sw.WriteLine(sentences[i].toRaw());
|
||||
}
|
||||
sw.Close();
|
||||
sw = File.CreateText(env.otherSounds);
|
||||
for (i++; i < sentences.Count; i++)
|
||||
{
|
||||
sw.WriteLine(sentences[i].toRaw());
|
||||
}
|
||||
sw.Close();
|
||||
}
|
||||
|
||||
private void switchLanguage(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
env = new Environment(((Language)e.AddedItems[0])); // AddedItems is a strange name. It contains the last selection
|
||||
loadLanguage();
|
||||
}
|
||||
|
||||
private void about(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
AboutWindow aboutWindow = new AboutWindow();
|
||||
aboutWindow.ShowDialog();
|
||||
}
|
||||
|
||||
private void addSentence(object sender, RoutedEventArgs e)
|
||||
{
|
||||
int i = 0;
|
||||
string newFile;
|
||||
do
|
||||
{
|
||||
newFile = "new_file_" + i.ToString();
|
||||
i++;
|
||||
}
|
||||
while (env.fileExists(newFile));
|
||||
sentences.Add(new Sentence(newFile + ";New Description;New Voice Message", env.baseDir));
|
||||
|
||||
// Extremely ugly - direct access to the listview to scroll down and select the new object
|
||||
this.lvSentences.SelectedIndex = this.lvSentences.Items.Count - 1;
|
||||
this.lvSentences.ScrollIntoView(this.lvSentences.SelectedItem);
|
||||
}
|
||||
|
||||
private void play(object sender, EventArgs e)
|
||||
{
|
||||
if (this.lvSentences.SelectedItems.Count < 1)
|
||||
return;
|
||||
|
||||
if (isRecording)
|
||||
stop(null, null);
|
||||
|
||||
Sentence sentence = (Sentence)this.lvSentences.SelectedItem;
|
||||
if (sentence.fileExists)
|
||||
{
|
||||
try
|
||||
{
|
||||
SoundPlayer player = new SoundPlayer(sentence.fullPath);
|
||||
player.Play();
|
||||
}
|
||||
catch (Exception) { }; // Catch and disregard all media exceptions
|
||||
}
|
||||
}
|
||||
|
||||
private void record(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.lvSentences.SelectedItems.Count < 1) return;
|
||||
|
||||
if (isRecording)
|
||||
stop(sender, e);
|
||||
else
|
||||
{
|
||||
saveLanguage();
|
||||
isRecording = true;
|
||||
lblRecording.Visibility = System.Windows.Visibility.Visible;
|
||||
Sentence sentence = (Sentence)this.lvSentences.SelectedItem;
|
||||
string path = sentence.fullPath;
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(path)); // Create directory if it doesn't exist
|
||||
System.IO.File.WriteAllText(path, ""); // Create and flush the file
|
||||
|
||||
filewriter = new WavFileWriter(path, recSamplerate, recBits, recChannels);
|
||||
WaveFormat fmt = new WaveFormat(recSamplerate, recBits, recChannels);
|
||||
recorder = new WaveInRecorder(-1, fmt, recBuffersize, this.DataArrived);
|
||||
}
|
||||
}
|
||||
|
||||
private void stop(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isRecording || this.lvSentences.SelectedItems.Count < 1)
|
||||
return;
|
||||
|
||||
isRecording = false;
|
||||
recorder.Close();
|
||||
filewriter.Close();
|
||||
|
||||
|
||||
int index = this.lvSentences.SelectedIndex;
|
||||
lblRecording.Visibility = System.Windows.Visibility.Hidden;
|
||||
Sentence sentence = (Sentence)this.lvSentences.SelectedItem;
|
||||
loadLanguage(); // Called to refresh the sentence data of the current langugae
|
||||
this.lvSentences.SelectedIndex = index;
|
||||
|
||||
wavProcessor processor = new wavProcessor();
|
||||
int noiceLevel = (int)this.noiceLevelSlider.Value;
|
||||
processor.StripSilence(sentence.fullPath, noiceLevel);
|
||||
processor.ToneIn(sentence.fullPath);
|
||||
processor.ToneOut(sentence.fullPath);
|
||||
processor.SpeedUp(sentence.fullPath, (int)this.speedSlider.Value);
|
||||
}
|
||||
|
||||
private void DataArrived(IntPtr data, int size)
|
||||
{
|
||||
Marshal.Copy(data, recordingBuffer, 0, size);
|
||||
filewriter.Write(recordingBuffer, size);
|
||||
}
|
||||
}
|
||||
|
||||
public class Environment
|
||||
{
|
||||
public Language lang { get; set; }
|
||||
public string baseDir { get { return @"SOUNDS\" + lang.sName + @"\"; } }
|
||||
public string sysDir { get { return @"SOUNDS\" + lang.sName + @"\SYSTEM\"; } }
|
||||
public string otherSounds { get { return baseDir + "other_sounds.txt"; } }
|
||||
public string systemSounds { get { return sysDir + "system_sounds.txt"; } }
|
||||
|
||||
public bool fileExists(string fName)
|
||||
{
|
||||
if (File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + baseDir + fName + ".wav"))
|
||||
return true;
|
||||
if (File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + sysDir + fName + ".wav"))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public Environment(Language language)
|
||||
{
|
||||
lang = language;
|
||||
}
|
||||
}
|
||||
|
||||
// Data container classes
|
||||
|
||||
public class Languages : ObservableCollection<Language>
|
||||
{
|
||||
public void Add(string longer, string shorter)
|
||||
{
|
||||
this.Add(new Language { lName = longer, sName = shorter });
|
||||
}
|
||||
}
|
||||
|
||||
public class Language
|
||||
{
|
||||
public string lName { get; set; }
|
||||
public string sName { get; set; }
|
||||
}
|
||||
|
||||
public class Sentences : ObservableCollection<Sentence>
|
||||
{
|
||||
public void Add(string rawString, string dirPath)
|
||||
{
|
||||
this.Add(new Sentence(rawString, dirPath));
|
||||
}
|
||||
}
|
||||
|
||||
public class Sentence
|
||||
{
|
||||
public bool fileExists { get; set; }
|
||||
public string fileName { get; set; }
|
||||
public string description { get; set; }
|
||||
public string voiceString { get; set; }
|
||||
public string path { get; set; }
|
||||
|
||||
public Sentence(string rawString, string dirPath)
|
||||
{
|
||||
string[] words = rawString.Split(';');
|
||||
fileName = words[0].TrimStart(' ', '\"');
|
||||
description = words[1];
|
||||
voiceString = words[2].TrimEnd('\"', ',', ' ');
|
||||
path = dirPath;
|
||||
fileExists = File.Exists(fullPath);
|
||||
}
|
||||
|
||||
public string fullPath
|
||||
{
|
||||
get { return System.AppDomain.CurrentDomain.BaseDirectory + path + fileName + ".wav"; }
|
||||
}
|
||||
|
||||
public string toRaw()
|
||||
{
|
||||
return "\"" + fileName + ";" + description + ";" + voiceString + "\",";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,172 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{8143D08D-1861-42DD-A861-56B15DE42A69}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>OpenTXrecorder</RootNamespace>
|
||||
<AssemblyName>OpenTXrecorder</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>icon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Speech" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Xaml">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="AboutWindow.xaml.cs">
|
||||
<DependentUpon>AboutWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="clsWaveProcessor.cs" />
|
||||
<Compile Include="sentencetables.cs" />
|
||||
<Compile Include="WaveIn.cs" />
|
||||
<Compile Include="WaveNative.cs" />
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Page Include="AboutWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<AppDesigner Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="recorder_logo.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="GPLv3_Logo.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="icon.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="play.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="record.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="stop.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -1,101 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using WaveLib;
|
||||
|
||||
namespace AudioRecorder
|
||||
{
|
||||
class Program
|
||||
{
|
||||
WavFileWriter filewriter;
|
||||
byte[] tmparray;
|
||||
|
||||
void Go()
|
||||
{
|
||||
int samplerate = 16000;
|
||||
int bits = 16; // 8 or 16
|
||||
int channels = 1; // 1 or 2
|
||||
|
||||
filewriter = new WavFileWriter("out.wav", samplerate, bits, channels);
|
||||
|
||||
WaveFormat fmt = new WaveFormat(samplerate, bits, channels);
|
||||
|
||||
// devicenumber, wavformat, buffersize, callback
|
||||
int buffersize = 16384;
|
||||
WaveInRecorder rec = new WaveInRecorder(-1, fmt, buffersize, this.DataArrived);
|
||||
tmparray = new byte[buffersize];
|
||||
|
||||
Console.WriteLine("Recording - press Enter to end");
|
||||
Console.ReadLine();
|
||||
rec.Close();
|
||||
|
||||
filewriter.Close();
|
||||
|
||||
Console.WriteLine("Bye");
|
||||
}
|
||||
|
||||
private void DataArrived(IntPtr data, int size)
|
||||
{
|
||||
Console.WriteLine("DataArrived {0} bytes", size);
|
||||
Marshal.Copy(data, tmparray, 0, size);
|
||||
filewriter.Write(tmparray);
|
||||
}
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
new Program().Go();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class WavFileWriter
|
||||
{
|
||||
BinaryWriter filewriter;
|
||||
long audiobyteswritten;
|
||||
|
||||
public WavFileWriter(string filename, int samplerate, int bits, int channels)
|
||||
{
|
||||
filewriter = new BinaryWriter(File.Open(filename, FileMode.Create));
|
||||
|
||||
filewriter.Write((uint)0x46464952); // "RIFF"
|
||||
filewriter.Write((uint)0); // chunkisize (filled in when we close)
|
||||
filewriter.Write((uint)0x45564157); // "WAVE"
|
||||
|
||||
// subchunk1
|
||||
filewriter.Write((uint)0x20746d66); // "fmt "
|
||||
filewriter.Write((uint)16);
|
||||
filewriter.Write((UInt16)1);
|
||||
filewriter.Write((UInt16)channels);
|
||||
filewriter.Write((uint)samplerate);
|
||||
filewriter.Write((uint)(channels*samplerate*bits/8));
|
||||
filewriter.Write((UInt16)(channels*bits/8));
|
||||
filewriter.Write((UInt16)bits);
|
||||
|
||||
// subchunk2
|
||||
filewriter.Write((uint)0x61746164); // "data"
|
||||
filewriter.Write((uint)0); // chunkisize (filled in when we close)
|
||||
}
|
||||
|
||||
public void Write(byte[] data)
|
||||
{
|
||||
filewriter.Write(data);
|
||||
audiobyteswritten += data.Length;
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
filewriter.Seek(4, SeekOrigin.Begin);
|
||||
filewriter.Write((uint)(audiobyteswritten + 36)); // 36 = total size of chunk headers
|
||||
|
||||
filewriter.Seek(40, SeekOrigin.Begin);
|
||||
filewriter.Write((uint)audiobyteswritten);
|
||||
|
||||
filewriter.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
/* This file is part of OpenTX Recorder.
|
||||
* OpenTX Recorder 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* OpenTX Recorder 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.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with OpenTX Recorder. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Copyright 2014 Kjell Kernen */
|
||||
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("OpenTX Recorder")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("OpenTX Team")]
|
||||
[assembly: AssemblyProduct("OpenTX Recorder")]
|
||||
[assembly: AssemblyCopyright("Copyright © Kjell Kernen 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
//In order to begin building localizable applications, set
|
||||
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
||||
//inside a <PropertyGroup>. For example, if you are using US english
|
||||
//in your source files, set the <UICulture> to en-US. Then uncomment
|
||||
//the NeutralResourceLanguage attribute below. Update the "en-US" in
|
||||
//the line below to match the UICulture setting in the project file.
|
||||
|
||||
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
||||
|
||||
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
||||
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("0.4")]
|
||||
[assembly: AssemblyFileVersion("0.4")]
|
||||
@@ -1,63 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18444
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace OpenTXrecorder.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenTXrecorder.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,117 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -1,26 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18444
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace OpenTXrecorder.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -1,214 +0,0 @@
|
||||
/* This file is part of OpenTX Recorder.
|
||||
* OpenTX Recorder 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* This code 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.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with OpenTX Recorder. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Copyright 2014 Tomas Andersson */
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace WaveLib
|
||||
{
|
||||
public delegate void BufferDoneEventHandler(IntPtr data, int size);
|
||||
|
||||
internal class WaveInBuffer
|
||||
{
|
||||
private ManualResetEvent m_RecordEvent = new ManualResetEvent(false);
|
||||
private IntPtr m_WaveIn;
|
||||
|
||||
private WaveNative.WaveHdr m_Header;
|
||||
private byte[] m_HeaderData;
|
||||
private GCHandle m_HeaderHandle;
|
||||
private GCHandle m_HeaderDataHandle;
|
||||
|
||||
internal static void WaveInProc(IntPtr hdrvr, int uMsg, int dwUser, ref WaveNative.WaveHdr wavhdr, int dwParam2)
|
||||
{
|
||||
if (uMsg == WaveNative.MM_WIM_DATA)
|
||||
{
|
||||
GCHandle h = (GCHandle)wavhdr.dwUser;
|
||||
WaveInBuffer buf = (WaveInBuffer)h.Target;
|
||||
buf.OnCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
public WaveInBuffer(IntPtr waveInHandle, int size)
|
||||
{
|
||||
m_WaveIn = waveInHandle;
|
||||
|
||||
m_HeaderHandle = GCHandle.Alloc(m_Header, GCHandleType.Pinned);
|
||||
m_Header.dwUser = (IntPtr)GCHandle.Alloc(this);
|
||||
m_HeaderData = new byte[size];
|
||||
m_HeaderDataHandle = GCHandle.Alloc(m_HeaderData, GCHandleType.Pinned);
|
||||
m_Header.lpData = m_HeaderDataHandle.AddrOfPinnedObject();
|
||||
m_Header.dwBufferLength = size;
|
||||
WaveInRecorder.ThrowOnError(WaveNative.waveInPrepareHeader(m_WaveIn, ref m_Header, Marshal.SizeOf(m_Header)));
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
WaveInRecorder.ThrowOnError(WaveNative.waveInUnprepareHeader(m_WaveIn, ref m_Header, Marshal.SizeOf(m_Header)));
|
||||
m_HeaderHandle.Free();
|
||||
m_Header.lpData = IntPtr.Zero;
|
||||
m_HeaderDataHandle.Free();
|
||||
}
|
||||
|
||||
public int Size
|
||||
{
|
||||
get { return m_Header.dwBufferLength; }
|
||||
}
|
||||
|
||||
public IntPtr Data
|
||||
{
|
||||
get { return m_Header.lpData; }
|
||||
}
|
||||
|
||||
public void Record()
|
||||
{
|
||||
m_RecordEvent.Reset();
|
||||
WaveInRecorder.ThrowOnError(WaveNative.waveInAddBuffer(m_WaveIn, ref m_Header, Marshal.SizeOf(m_Header)));
|
||||
}
|
||||
|
||||
public void WaitFor()
|
||||
{
|
||||
m_RecordEvent.WaitOne();
|
||||
}
|
||||
|
||||
private void OnCompleted()
|
||||
{
|
||||
m_RecordEvent.Set();
|
||||
}
|
||||
}
|
||||
|
||||
public class WavFileWriter
|
||||
{
|
||||
BinaryWriter filewriter;
|
||||
long audiobyteswritten;
|
||||
|
||||
public WavFileWriter(string filename, int samplerate, int bits, int channels)
|
||||
{
|
||||
filewriter = new BinaryWriter(File.Open(filename, FileMode.Create));
|
||||
|
||||
filewriter.Write((uint)0x46464952); // "RIFF"
|
||||
filewriter.Write((uint)0); // chunkisize (filled in when we close)
|
||||
filewriter.Write((uint)0x45564157); // "WAVE"
|
||||
|
||||
// subchunk1
|
||||
filewriter.Write((uint)0x20746d66); // "fmt "
|
||||
filewriter.Write((uint)16);
|
||||
filewriter.Write((UInt16)1);
|
||||
filewriter.Write((UInt16)channels);
|
||||
filewriter.Write((uint)samplerate);
|
||||
filewriter.Write((uint)(channels * samplerate * bits / 8));
|
||||
filewriter.Write((UInt16)(channels * bits / 8));
|
||||
filewriter.Write((UInt16)bits);
|
||||
|
||||
// subchunk2
|
||||
filewriter.Write((uint)0x61746164); // "data"
|
||||
filewriter.Write((uint)0); // chunkisize (filled in when we close)
|
||||
}
|
||||
|
||||
public void Write(byte[] data, int size)
|
||||
{
|
||||
filewriter.Write(data, 0, size);
|
||||
audiobyteswritten += size;
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
filewriter.Seek(4, SeekOrigin.Begin);
|
||||
filewriter.Write((uint)(audiobyteswritten + 36)); // 36 = total size of chunk headers
|
||||
|
||||
filewriter.Seek(40, SeekOrigin.Begin);
|
||||
filewriter.Write((uint)audiobyteswritten);
|
||||
|
||||
filewriter.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public class WaveInRecorder
|
||||
{
|
||||
private IntPtr m_WaveIn;
|
||||
private WaveInBuffer buffer1, buffer2;
|
||||
private WaveInBuffer m_CurrentBuffer;
|
||||
private Thread m_Thread;
|
||||
private BufferDoneEventHandler m_DoneProc;
|
||||
private bool m_Finished;
|
||||
|
||||
private WaveNative.WaveDelegate m_BufferProc = new WaveNative.WaveDelegate(WaveInBuffer.WaveInProc);
|
||||
|
||||
public static int DeviceCount
|
||||
{
|
||||
get { return WaveNative.waveInGetNumDevs(); }
|
||||
}
|
||||
|
||||
public WaveInRecorder(int device, WaveFormat format, int bufferSize, BufferDoneEventHandler doneProc)
|
||||
{
|
||||
m_DoneProc = doneProc;
|
||||
WaveInRecorder.ThrowOnError(WaveNative.waveInOpen(out m_WaveIn, device, format, m_BufferProc, 0, WaveNative.CALLBACK_FUNCTION));
|
||||
|
||||
buffer1 = new WaveInBuffer(m_WaveIn, bufferSize);
|
||||
buffer2 = new WaveInBuffer(m_WaveIn, bufferSize);
|
||||
|
||||
buffer1.Record();
|
||||
buffer2.Record();
|
||||
|
||||
m_CurrentBuffer = buffer1;
|
||||
|
||||
WaveInRecorder.ThrowOnError(WaveNative.waveInStart(m_WaveIn));
|
||||
m_Thread = new Thread(new ThreadStart(ThreadProc));
|
||||
m_Thread.Start();
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
m_Finished = true;
|
||||
WaveInRecorder.ThrowOnError(WaveNative.waveInReset(m_WaveIn));
|
||||
|
||||
m_Thread.Join();
|
||||
m_Thread = null;
|
||||
m_DoneProc = null;
|
||||
|
||||
buffer1.WaitFor();
|
||||
buffer2.WaitFor();
|
||||
|
||||
buffer1.Close();
|
||||
buffer2.Close();
|
||||
|
||||
WaveInRecorder.ThrowOnError(WaveNative.waveInClose(m_WaveIn));
|
||||
m_WaveIn = IntPtr.Zero;
|
||||
}
|
||||
|
||||
private void ThreadProc()
|
||||
{
|
||||
while (!m_Finished)
|
||||
{
|
||||
m_CurrentBuffer = (m_CurrentBuffer == buffer1) ? buffer2 : buffer1;
|
||||
|
||||
m_CurrentBuffer.WaitFor();
|
||||
m_DoneProc(m_CurrentBuffer.Data, m_CurrentBuffer.Size);
|
||||
|
||||
if (m_Finished) break;
|
||||
|
||||
m_CurrentBuffer.Record();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ThrowOnError(int err)
|
||||
{
|
||||
if (err != WaveNative.MMSYSERR_NOERROR) throw new Exception(err.ToString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
|
||||
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
|
||||
// PURPOSE.
|
||||
//
|
||||
// Email: ianier@hotmail.com
|
||||
//
|
||||
// Copyright (C) 1999-2003 Ianier Munoz. All Rights Reserved.
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace WaveLib
|
||||
{
|
||||
public enum WaveFormats
|
||||
{
|
||||
Pcm = 1,
|
||||
Float = 3
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class WaveFormat
|
||||
{
|
||||
public short wFormatTag;
|
||||
public short nChannels;
|
||||
public int nSamplesPerSec;
|
||||
public int nAvgBytesPerSec;
|
||||
public short nBlockAlign;
|
||||
public short wBitsPerSample;
|
||||
public short cbSize;
|
||||
|
||||
public WaveFormat(int rate, int bits, int channels)
|
||||
{
|
||||
wFormatTag = (short)WaveFormats.Pcm;
|
||||
nChannels = (short)channels;
|
||||
nSamplesPerSec = rate;
|
||||
wBitsPerSample = (short)bits;
|
||||
cbSize = 0;
|
||||
|
||||
nBlockAlign = (short)(channels * (bits / 8));
|
||||
nAvgBytesPerSec = nSamplesPerSec * nBlockAlign;
|
||||
}
|
||||
}
|
||||
|
||||
internal class WaveNative
|
||||
{
|
||||
// consts
|
||||
public const int MMSYSERR_NOERROR = 0; // no error
|
||||
|
||||
public const int MM_WOM_OPEN = 0x3BB;
|
||||
public const int MM_WOM_CLOSE = 0x3BC;
|
||||
public const int MM_WOM_DONE = 0x3BD;
|
||||
|
||||
public const int MM_WIM_OPEN = 0x3BE;
|
||||
public const int MM_WIM_CLOSE = 0x3BF;
|
||||
public const int MM_WIM_DATA = 0x3C0;
|
||||
|
||||
public const int CALLBACK_FUNCTION = 0x00030000; // dwCallback is a FARPROC
|
||||
|
||||
public const int TIME_MS = 0x0001; // time in milliseconds
|
||||
public const int TIME_SAMPLES = 0x0002; // number of wave samples
|
||||
public const int TIME_BYTES = 0x0004; // current byte offset
|
||||
|
||||
// callbacks
|
||||
public delegate void WaveDelegate(IntPtr hdrvr, int uMsg, int dwUser, ref WaveHdr wavhdr, int dwParam2);
|
||||
|
||||
// structs
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)] public struct WaveHdr
|
||||
{
|
||||
public IntPtr lpData; // pointer to locked data buffer
|
||||
public int dwBufferLength; // length of data buffer
|
||||
public int dwBytesRecorded; // used for input only
|
||||
public IntPtr dwUser; // for client's use
|
||||
public int dwFlags; // assorted flags (see defines)
|
||||
public int dwLoops; // loop control counter
|
||||
public IntPtr lpNext; // PWaveHdr, reserved for driver
|
||||
public int reserved; // reserved for driver
|
||||
}
|
||||
|
||||
private const string mmdll = "winmm.dll";
|
||||
|
||||
// WaveOut calls
|
||||
[DllImport(mmdll)]
|
||||
public static extern int waveOutGetNumDevs();
|
||||
[DllImport(mmdll)]
|
||||
public static extern int waveOutPrepareHeader(IntPtr hWaveOut, ref WaveHdr lpWaveOutHdr, int uSize);
|
||||
[DllImport(mmdll)]
|
||||
public static extern int waveOutUnprepareHeader(IntPtr hWaveOut, ref WaveHdr lpWaveOutHdr, int uSize);
|
||||
[DllImport(mmdll)]
|
||||
public static extern int waveOutWrite(IntPtr hWaveOut, ref WaveHdr lpWaveOutHdr, int uSize);
|
||||
[DllImport(mmdll)]
|
||||
public static extern int waveOutOpen(out IntPtr hWaveOut, int uDeviceID, WaveFormat lpFormat, WaveDelegate dwCallback, int dwInstance, int dwFlags);
|
||||
[DllImport(mmdll)]
|
||||
public static extern int waveOutReset(IntPtr hWaveOut);
|
||||
[DllImport(mmdll)]
|
||||
public static extern int waveOutClose(IntPtr hWaveOut);
|
||||
[DllImport(mmdll)]
|
||||
public static extern int waveOutPause(IntPtr hWaveOut);
|
||||
[DllImport(mmdll)]
|
||||
public static extern int waveOutRestart(IntPtr hWaveOut);
|
||||
[DllImport(mmdll)]
|
||||
public static extern int waveOutGetPosition(IntPtr hWaveOut, out int lpInfo, int uSize);
|
||||
[DllImport(mmdll)]
|
||||
public static extern int waveOutSetVolume(IntPtr hWaveOut, int dwVolume);
|
||||
[DllImport(mmdll)]
|
||||
public static extern int waveOutGetVolume(IntPtr hWaveOut, out int dwVolume);
|
||||
|
||||
// WaveIn calls
|
||||
[DllImport(mmdll)]
|
||||
public static extern int waveInGetNumDevs();
|
||||
[DllImport(mmdll)]
|
||||
public static extern int waveInAddBuffer(IntPtr hwi, ref WaveHdr pwh, int cbwh);
|
||||
[DllImport(mmdll)]
|
||||
public static extern int waveInClose(IntPtr hwi);
|
||||
[DllImport(mmdll)]
|
||||
public static extern int waveInOpen(out IntPtr phwi, int uDeviceID, WaveFormat lpFormat, WaveDelegate dwCallback, int dwInstance, int dwFlags);
|
||||
[DllImport(mmdll)]
|
||||
public static extern int waveInPrepareHeader(IntPtr hWaveIn, ref WaveHdr lpWaveInHdr, int uSize);
|
||||
[DllImport(mmdll)]
|
||||
public static extern int waveInUnprepareHeader(IntPtr hWaveIn, ref WaveHdr lpWaveInHdr, int uSize);
|
||||
[DllImport(mmdll)]
|
||||
public static extern int waveInReset(IntPtr hwi);
|
||||
[DllImport(mmdll)]
|
||||
public static extern int waveInStart(IntPtr hwi);
|
||||
[DllImport(mmdll)]
|
||||
public static extern int waveInStop(IntPtr hwi);
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
<Window x:Class="OpenTXrecorder.AboutWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="OpenTX Recorder About Window" Height="350" Width="357" Icon="/OpenTXrecorder;component/icon.ico">
|
||||
<Grid>
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel Orientation="Vertical">
|
||||
<StackPanel Orientation="Horizontal" Width="240" HorizontalAlignment="Left">
|
||||
<Label Content="Product:">
|
||||
</Label>
|
||||
<Label Content="Product Name" Name="lblProductName"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<Label Content="Version:"/>
|
||||
<Label Content="Version" Name="lblVersion"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<Label Content="Company:" />
|
||||
<Label Content="Company" Name="lblCompanyName"/>
|
||||
</StackPanel>
|
||||
<Label Content="Copyright" Name="lblCopyright" HorizontalAlignment="Left" />
|
||||
</StackPanel>
|
||||
<TextBlock>
|
||||
<Hyperlink NavigateUri="http://www.open-tx.org/" RequestNavigate="Hyperlink_RequestNavigate">
|
||||
<Image Stretch="Uniform" Height="90" Width="90" Cursor="Hand" Source="/OpenTXrecorder;component/icon.ico" />
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock Margin="5,5,5,0" TextWrapping="Wrap"
|
||||
Text="This application is used to record OpenTX voice strings and generate audio files for use in the FrSky Taranis radio." />
|
||||
<TextBlock Margin="5,10,5,0" TextWrapping="Wrap"
|
||||
Text= "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 3 of the License, or any later version." />
|
||||
<TextBlock Margin="5,5,5,0" TextWrapping="Wrap"
|
||||
Text= "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." />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock TextWrapping="Wrap" Margin="5,5,5,0" Width="230"
|
||||
Text= "See the GNU General Public License for more details." />
|
||||
<TextBlock>
|
||||
<Hyperlink NavigateUri="http://www.gnu.org/licenses/" RequestNavigate="Hyperlink_RequestNavigate">
|
||||
<Image Margin="0,5,0,0" Cursor="Hand" Source="/OpenTXrecorder;component/GPLv3_Logo.png" MinWidth="88" MaxWidth="88" />
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -1,62 +0,0 @@
|
||||
/* This file is part of OpenTX Recorder.
|
||||
* OpenTX Recorder 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* OpenTX Recorder 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.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with OpenTX Recorder. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Copyright 2014 Kjell Kernen */
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using System.Windows.Navigation;
|
||||
|
||||
|
||||
namespace OpenTXrecorder
|
||||
{
|
||||
public partial class AboutWindow : Window
|
||||
{
|
||||
public AboutWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
Assembly app = Assembly.GetExecutingAssembly();
|
||||
|
||||
AssemblyTitleAttribute title = (AssemblyTitleAttribute)app.GetCustomAttributes(typeof(AssemblyTitleAttribute), false)[0];
|
||||
AssemblyProductAttribute product = (AssemblyProductAttribute)app.GetCustomAttributes(typeof(AssemblyProductAttribute), false)[0];
|
||||
AssemblyCopyrightAttribute copyright = (AssemblyCopyrightAttribute)app.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false)[0];
|
||||
AssemblyCompanyAttribute company = (AssemblyCompanyAttribute)app.GetCustomAttributes(typeof(AssemblyCompanyAttribute), false)[0];
|
||||
Version version = app.GetName().Version;
|
||||
|
||||
this.Title = String.Format("About {0}", title.Title);
|
||||
this.lblProductName.Content = product.Product;
|
||||
this.lblVersion.Content = String.Format("Version {0}", version.ToString());
|
||||
this.lblCopyright.Content = copyright.Copyright.ToString();
|
||||
this.lblCompanyName.Content = company.Company;
|
||||
}
|
||||
|
||||
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
|
||||
{
|
||||
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,286 +0,0 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using WaveLib;
|
||||
|
||||
|
||||
public class wavProcessor
|
||||
{
|
||||
public int Length;
|
||||
public short Channels;
|
||||
public int SampleRate;
|
||||
public int DataLength;
|
||||
public short BitsPerSample;
|
||||
|
||||
/// <summary>
|
||||
/// Filter out silence or noise from start and end of wave file.
|
||||
/// </summary>
|
||||
/// <param name="strPath">Source wave file</param>
|
||||
/// <param name="noiceLevel">Absolute value for noice threshold</param>
|
||||
/// <returns>True/False</returns>
|
||||
public bool StripSilence(string strPath, int noiceLevel)
|
||||
{
|
||||
if ((strPath == null) || (strPath == ""))
|
||||
return false;
|
||||
|
||||
// Read from file
|
||||
wavProcessor wain = new wavProcessor();
|
||||
if (!wain.WaveHeaderIN(@strPath)) return false;
|
||||
byte[] arrfile = GetWAVEData(strPath);
|
||||
|
||||
int startpos = 0;
|
||||
int endpos = arrfile.Length - 1;
|
||||
|
||||
// Check for silence at start
|
||||
for (int j = 0; isSilence(arrfile, j, noiceLevel); j += 20)
|
||||
startpos = j;
|
||||
|
||||
// Allow room for tone-in buffer
|
||||
int buffer = wain.SampleRate * (wain.BitsPerSample / 8) / 32; // 1/32 seconds lead time
|
||||
startpos = startpos - buffer;
|
||||
if (startpos < 0)
|
||||
startpos = 0;
|
||||
|
||||
// Check for silence at end. No need to check tone out buffer
|
||||
for (int k = arrfile.Length - buffer; (k >= 0) && (isSilence(arrfile, k, noiceLevel)); k -= 20)
|
||||
endpos = k;
|
||||
|
||||
// Allow room for tone-out buffer
|
||||
endpos = endpos + buffer;
|
||||
if (endpos > arrfile.Length)
|
||||
endpos = arrfile.Length - 2;
|
||||
|
||||
if (startpos >= endpos)
|
||||
return false;
|
||||
|
||||
byte[] newarr = new byte[endpos - startpos];
|
||||
for (int ni = 0, m = startpos; ni < newarr.Length; m++, ni++)
|
||||
newarr[ni] = arrfile[m];
|
||||
|
||||
// write file back
|
||||
WavFileWriter writer = new WavFileWriter(@strPath, wain.SampleRate, wain.BitsPerSample, wain.Channels);
|
||||
writer.Write(newarr, newarr.Length);
|
||||
writer.Close();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Helper function that checks if the next 10 samples is silence
|
||||
private bool isSilence(byte[] buff, int index, int noiceLevel)
|
||||
{
|
||||
if (buff.Length <= (index + 20))
|
||||
return false;
|
||||
|
||||
int totalSnd = 0;
|
||||
for (int i = 0; i < 20; i += 2)
|
||||
{
|
||||
short snd = ComplementToSigned(ref buff, i + index);
|
||||
if (snd < 0)
|
||||
snd = (short)(snd * -1);
|
||||
totalSnd += snd;
|
||||
}
|
||||
return (totalSnd < (10 * noiceLevel));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tone in wav file
|
||||
/// </summary>
|
||||
/// <param name="strPath">Source wave</param>
|
||||
/// <returns>True/False</returns>
|
||||
public bool ToneIn(string strPath)
|
||||
{
|
||||
if ((strPath == null) || (strPath == ""))
|
||||
return false;
|
||||
|
||||
// Read from file
|
||||
wavProcessor wain = new wavProcessor();
|
||||
if (!wain.WaveHeaderIN(@strPath)) return false;
|
||||
byte[] arrfile = GetWAVEData(strPath);
|
||||
|
||||
// Calculate constants
|
||||
int start = 0;
|
||||
int end = wain.SampleRate * (wain.BitsPerSample / 8) / 16; // 1/16 seconds
|
||||
int span = end - start;
|
||||
|
||||
//change volume
|
||||
for (int j = start; j < end; j += 2)
|
||||
{
|
||||
short snd = ComplementToSigned(ref arrfile, j);
|
||||
snd = Convert.ToInt16(snd * (j / span));
|
||||
byte[] newval = SignedToComplement(snd);
|
||||
arrfile[j] = newval[0];
|
||||
arrfile[j + 1] = newval[1];
|
||||
}
|
||||
// write file back
|
||||
WavFileWriter writer = new WavFileWriter(@strPath, wain.SampleRate, wain.BitsPerSample, wain.Channels);
|
||||
writer.Write(arrfile, arrfile.Length);
|
||||
writer.Close();
|
||||
|
||||
return true;
|
||||
}
|
||||
/// <summary>
|
||||
/// Tone out wav file
|
||||
/// </summary>
|
||||
/// <param name="strPath">Source wave</param>
|
||||
/// <returns>True/False</returns>
|
||||
public bool ToneOut(string strPath)
|
||||
{
|
||||
if ((strPath == null) || (strPath == ""))
|
||||
return false;
|
||||
|
||||
// Read from file
|
||||
wavProcessor wain = new wavProcessor();
|
||||
if (!wain.WaveHeaderIN(@strPath)) return false;
|
||||
byte[] arrfile = GetWAVEData(strPath);
|
||||
|
||||
// Calculate constants
|
||||
int end = wain.Length;
|
||||
int start = end - (wain.SampleRate * (wain.BitsPerSample / 8) / 16); // 1/16 seconds from end
|
||||
int span = end - start;
|
||||
|
||||
//change volume
|
||||
for (int j = start; j < arrfile.Length; j += 2)
|
||||
{
|
||||
short snd = ComplementToSigned(ref arrfile, j);
|
||||
snd = Convert.ToInt16(snd * (end - j) / span);
|
||||
|
||||
byte[] newval = SignedToComplement(snd);
|
||||
arrfile[j] = newval[0];
|
||||
arrfile[j + 1] = newval[1];
|
||||
}
|
||||
// write file back
|
||||
WavFileWriter writer = new WavFileWriter(@strPath, wain.SampleRate, wain.BitsPerSample, wain.Channels);
|
||||
writer.Write(arrfile, arrfile.Length);
|
||||
writer.Close();
|
||||
|
||||
return true;
|
||||
}
|
||||
/// <summary>
|
||||
/// Speed up wav file to mimic Donald Duck
|
||||
/// </summary>
|
||||
/// <param name="strPath">Source wave</param>
|
||||
/// <param name="speed">Speed between 0 and 19 </param>
|
||||
/// <returns>True/False</returns>
|
||||
public bool SpeedUp(string strPath, int speed)
|
||||
{
|
||||
if ((strPath == null) || (strPath == ""))
|
||||
return false;
|
||||
|
||||
if ((speed < 0) || (speed > 19))
|
||||
return false;
|
||||
|
||||
// Read from file
|
||||
wavProcessor wain = new wavProcessor();
|
||||
if (!wain.WaveHeaderIN(@strPath)) return false;
|
||||
byte[] arrfile = GetWAVEData(strPath);
|
||||
byte[] newfile = new byte[arrfile.Length];
|
||||
|
||||
int skip = 21-speed;
|
||||
int j = 0;
|
||||
for (int i = 0; i < arrfile.Length; i += 2)
|
||||
{
|
||||
if (skip > 20 || (((i/2) % skip) != 0))
|
||||
{
|
||||
newfile[j] = arrfile[i];
|
||||
newfile[j + 1] = arrfile[i + 1];
|
||||
j += 2;
|
||||
}
|
||||
}
|
||||
// write file back
|
||||
WavFileWriter writer = new WavFileWriter(@strPath, wain.SampleRate, wain.BitsPerSample, wain.Channels);
|
||||
writer.Write(newfile, j);
|
||||
writer.Close();
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read the wave file header and store the key values in public variable.
|
||||
/// </summary>
|
||||
/// <param name="strPath">The physical path of wave file incl. file name for reading</param>
|
||||
/// <returns>True/False</returns>
|
||||
private bool WaveHeaderIN(string strPath)
|
||||
{
|
||||
if (strPath == null) strPath = "";
|
||||
if (strPath == "") return false;
|
||||
|
||||
FileStream fs = new FileStream(strPath, FileMode.Open, FileAccess.Read);
|
||||
|
||||
BinaryReader br = new BinaryReader(fs);
|
||||
try
|
||||
{
|
||||
Length = (int)fs.Length - 8;
|
||||
fs.Position = 22;
|
||||
Channels = br.ReadInt16(); //1
|
||||
fs.Position = 24;
|
||||
SampleRate = br.ReadInt32(); //16000
|
||||
fs.Position = 34;
|
||||
BitsPerSample = br.ReadInt16(); //16
|
||||
DataLength = (int)fs.Length - 44;
|
||||
byte[] arrfile = new byte[fs.Length - 44];
|
||||
fs.Position = 44;
|
||||
fs.Read(arrfile, 0, arrfile.Length);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
br.Close();
|
||||
fs.Close();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// In stereo wave format, samples are stored in 2's complement. For Mono, it's necessary to
|
||||
/// convert those samples to their equivalent signed value. This method is used
|
||||
/// by other public methods to equilibrate wave formats of different files.
|
||||
/// </summary>
|
||||
/// <param name="bytArr">Sample data in array</param>
|
||||
/// <param name="intPos">Array offset</param>
|
||||
/// <returns>Mono value as signed short</returns>
|
||||
private short ComplementToSigned(ref byte[] bytArr, int intPos) // 2's complement to normal signed value
|
||||
{
|
||||
short snd = BitConverter.ToInt16(bytArr, intPos);
|
||||
if (intPos >= bytArr.Length) return 0;
|
||||
if (snd != 0)
|
||||
snd = Convert.ToInt16((~snd | 1));
|
||||
return snd;
|
||||
}
|
||||
/// <summary>
|
||||
/// Convert signed sample value back to 2's complement value equivalent to Stereo. This method is used
|
||||
/// by other public methods to equilibrate wave formats of different files.
|
||||
/// </summary>
|
||||
/// <param name="shtVal">The mono signed value as short</param>
|
||||
/// <returns>Stereo 2's complement value as byte array</returns>
|
||||
private byte[] SignedToComplement(short shtVal) //Convert to 2's complement and return as byte array of 2 bytes
|
||||
{
|
||||
byte[] bt = new byte[2];
|
||||
shtVal = Convert.ToInt16((~shtVal | 1));
|
||||
bt = BitConverter.GetBytes(shtVal);
|
||||
return bt;
|
||||
}
|
||||
/// <summary>
|
||||
/// Read the WAVE file then position to DADA segment and return the chunk as byte array
|
||||
/// </summary>
|
||||
/// <param name="strWAVEPath">Path of WAVE file</param>
|
||||
/// <returns>byte array</returns>
|
||||
private byte[] GetWAVEData(string strWAVEPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
FileStream fs = new FileStream(@strWAVEPath, FileMode.Open, FileAccess.Read);
|
||||
byte[] arrfile = new byte[fs.Length - 44];
|
||||
fs.Position = 44;
|
||||
fs.Read(arrfile, 0, arrfile.Length);
|
||||
fs.Close();
|
||||
return arrfile;
|
||||
}
|
||||
catch (IOException ioex)
|
||||
{
|
||||
throw ioex;
|
||||
}
|
||||
}
|
||||
} // End of clsWaveProcessor class
|
||||
|
Before Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
@@ -1,3 +0,0 @@
|
||||
/OpenTXspeaker.suo
|
||||
/bin/*
|
||||
/obj/*
|
||||
@@ -1,8 +0,0 @@
|
||||
<Application x:Class="OpenTXspeak.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
@@ -1,32 +0,0 @@
|
||||
/* This file is part of OpenTX Speaker.
|
||||
* OpenTX Speaker 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* OpenTX Speaker 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.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with OpenTX Speaker. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Copyright 2014 Kjell Kernen */
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
|
||||
namespace OpenTXspeak
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 2.6 KiB |
@@ -1,151 +0,0 @@
|
||||
<Window x:Class="OpenTXspeak.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="OpenTX Speaker"
|
||||
Height="514"
|
||||
MinWidth="840"
|
||||
MaxWidth="840"
|
||||
ResizeMode="CanResizeWithGrip" MinHeight="514" SizeToContent="Width" Icon="/OpenTXspeaker;component/icon.ico">
|
||||
|
||||
<Grid VerticalAlignment="Stretch" >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid Grid.Row="0" Grid.Column="0" VerticalAlignment="Stretch">
|
||||
<ListView Name="lvSentences"
|
||||
SelectionMode="Single"
|
||||
MouseDoubleClick="lvSentences_MouseDoubleClick"
|
||||
VerticalAlignment="Stretch" >
|
||||
<ListView.View>
|
||||
<GridView>
|
||||
<GridView.Columns>
|
||||
<GridViewColumn Header="File Name" Width="100" DisplayMemberBinding="{Binding fileName}" />
|
||||
<GridViewColumn Header="Description" Width="200" DisplayMemberBinding="{Binding description}" />
|
||||
<GridViewColumn Header="Voice" Width="200" DisplayMemberBinding="{Binding voiceString}" />
|
||||
</GridView.Columns>
|
||||
</GridView>
|
||||
</ListView.View>
|
||||
</ListView>
|
||||
</Grid>
|
||||
|
||||
<StackPanel Grid.Row="0" Grid.Column="1">
|
||||
<TextBlock Text="Language" Margin="5,0,0,0" FontSize="18" />
|
||||
|
||||
<StackPanel Orientation="Vertical" HorizontalAlignment="Left" Margin="10,0,0,0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label Content="Text" Width="75" />
|
||||
<ComboBox Name="cbLanguages"
|
||||
DisplayMemberPath="lName"
|
||||
SelectedValuePath="sName"
|
||||
SelectionChanged="cbLanguages_SelectionChanged"
|
||||
Width="200" Height="23" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Label Content="Voice" Width="75" />
|
||||
<ComboBox Height="23" Name="cbVoices" Width="200" Margin="0,0,0,0"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<Separator Height="5" />
|
||||
<TextBlock Text="Sentence" Margin="5,0,0,0" FontSize="18" />
|
||||
<Grid Margin="10,0,0,0" DataContext="{Binding ElementName=lvSentences, Path=SelectedItem}" Width="Auto">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="75" />
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="File Name" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="0" Margin="0,5,0,0" />
|
||||
<TextBox Text="{Binding Path=fileName}" Grid.Row="0" Grid.Column="1" Margin=" 0,0,10,0" />
|
||||
<TextBlock Text="Description" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="1" Grid.Column="0" Margin="0,5,0,0" />
|
||||
<TextBox Text="{Binding Path=description}" Grid.Row="1" Grid.Column="1" Margin=" 0,0,10,0"/>
|
||||
<TextBlock Text="Sentence" Grid.Row="2" Grid.Column="0" Margin="0,5,0,0" />
|
||||
<TextBox Text="{Binding Path=voiceString}" Grid.Row="2" Grid.Column="1" Margin="0,0,10,0"/>
|
||||
</Grid>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,0">
|
||||
<TextBlock Text="Rate" Width="70" Margin="10,10,0,0" />
|
||||
<Slider Name="voiceRateSlider"
|
||||
Value="0"
|
||||
Minimum="-5"
|
||||
Maximum="5"
|
||||
TickPlacement="BottomRight"
|
||||
TickFrequency="1"
|
||||
IsSnapToTickEnabled="True"
|
||||
Width="170"
|
||||
Margin="10,10,10,0"/>
|
||||
<TextBlock Text="{Binding ElementName=voiceRateSlider, Path=Value}" Width="40" Margin="0,10,0,0"/>
|
||||
<TextBlock Text="Voice Rate" Width="70" Margin="10,10,0,0" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,0">
|
||||
<TextBlock Text="Volume" Width="70" Margin="10,10,0,0" />
|
||||
<Slider Name="voiceVolumeSlider"
|
||||
Value="50"
|
||||
Minimum="0"
|
||||
Maximum="100"
|
||||
TickPlacement="BottomRight"
|
||||
TickFrequency="10"
|
||||
IsSnapToTickEnabled="False"
|
||||
Width="170"
|
||||
Margin="10,10,10,0"/>
|
||||
<TextBlock Text="{Binding ElementName=voiceVolumeSlider, Path=Value}" Width="40" Margin="0,10,0,0"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<Button Content="New Sentence" Name="buttonAddItem" Click="buttonAddItem_Click" Margin="0,10,0,0" Width="140" />
|
||||
<Button Content="Play Sentence" Name="buttonPlay" Click="buttonPlay_Click" Margin="10,10,0,0" Width="140" />
|
||||
</StackPanel>
|
||||
<Separator Height="5" />
|
||||
<TextBlock Text="Voice Files" Margin="5,0,0,0" FontSize="18" />
|
||||
<StackPanel Orientation="Horizontal" >
|
||||
<TextBlock Text="Rate" Width="70" Margin="10,0,0,0" />
|
||||
<Slider Name="fileRateSlider"
|
||||
Value="0"
|
||||
Minimum="-5"
|
||||
Maximum="5"
|
||||
TickPlacement="BottomRight"
|
||||
TickFrequency="1"
|
||||
IsSnapToTickEnabled="True"
|
||||
Width="170"
|
||||
Margin="10,0,10,0"/>
|
||||
<TextBlock Text="{Binding ElementName=fileRateSlider, Path=Value}" Width="40" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,0">
|
||||
<TextBlock Text="Volume" Width="70" Margin="10,10,0,0" />
|
||||
<Slider Name="fileVolumeSlider"
|
||||
Value="50"
|
||||
Minimum="0"
|
||||
Maximum="100"
|
||||
TickPlacement="BottomRight"
|
||||
TickFrequency="10"
|
||||
IsSnapToTickEnabled="False"
|
||||
Width="170"
|
||||
Margin="10,10,10,0"/>
|
||||
<TextBlock Text="{Binding ElementName=fileVolumeSlider, Path=Value}" Width="40" Margin="0,10,0,0"/>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="Sample Rate" Width="70" Margin="10,10,0,0" />
|
||||
<RadioButton Content="8 KHz" Height="16" Name="rb8khz" Margin="10,10,0,0"/>
|
||||
<RadioButton Content="16 kHz" Height="16" Name="rb16khz" IsChecked="True" Margin="10,10,0,0" />
|
||||
<RadioButton Content="32 kHz" Height="16" Name="rb32khz" Margin="10,10,0,0"/>
|
||||
</StackPanel>
|
||||
<Button Content="Generate Voice Files" Name="buttonGenerate" Click="buttonSaveFiles_Click" Margin="10,10,10,0" />
|
||||
<Separator Height="5" />
|
||||
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Right">
|
||||
<TextBlock FontSize="18" VerticalAlignment="Center" MouseLeftButtonDown="InstallVoices_MouseLeftButtonDown" Cursor="Hand" HorizontalAlignment="Center" Margin="20,0,20,0" TextWrapping="Wrap" Height="48" Width="59" IsHyphenationEnabled="True">Install Voices</TextBlock>
|
||||
<Image Name="openTXLogo" Height="48" MouseLeftButtonDown="openTXLogo_MouseLeftButtonDown" HorizontalAlignment="Right" Cursor="Hand" Source="/OpenTXspeaker;component/speaker_logo.png" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -1,235 +0,0 @@
|
||||
/* This file is part of OpenTX Speaker.
|
||||
* OpenTX Speaker 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* OpenTX Speaker 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.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with OpenTX Speaker. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Copyright 2014 Kjell Kernen */
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Speech.Synthesis;
|
||||
using System.Speech.AudioFormat;
|
||||
|
||||
namespace OpenTXspeak
|
||||
{
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
SentenceTables tables = new SentenceTables();
|
||||
Languages languages = new Languages();
|
||||
Language curLang;
|
||||
Sentences sentences = new Sentences();
|
||||
SpeechSynthesizer synth = new SpeechSynthesizer();
|
||||
int added_files = 0;
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
SplashScreen splash = new SplashScreen("speaker_logo.png");
|
||||
splash.Show(true);
|
||||
Thread.Sleep(1500);
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
lvSentences.ItemsSource = sentences;
|
||||
cbLanguages.ItemsSource = languages;
|
||||
|
||||
foreach (InstalledVoice voice in synth.GetInstalledVoices())
|
||||
{
|
||||
cbVoices.Items.Add(voice.VoiceInfo.Name);
|
||||
}
|
||||
cbVoices.SelectedIndex = 0;
|
||||
|
||||
languages.Add("English", "en");
|
||||
languages.Add("Czech", "cz");
|
||||
languages.Add("German", "de");
|
||||
languages.Add("French", "fr");
|
||||
languages.Add("Italian", "it");
|
||||
languages.Add("Polish", "pl");
|
||||
languages.Add("Portuguese", "pt");
|
||||
languages.Add("Swedish", "se");
|
||||
languages.Add("Slovak", "sk");
|
||||
languages.Add("Spanish", "es");
|
||||
curLang = languages[0];
|
||||
cbLanguages.SelectedIndex = 0; // Note: Sets current langugage -> triggers loadlanguage()
|
||||
}
|
||||
|
||||
private void loadLanguage()
|
||||
{
|
||||
string[] system_strings;
|
||||
string[] other_strings;
|
||||
|
||||
try
|
||||
{
|
||||
system_strings = System.IO.File.ReadAllLines(@"SOUNDS\" + curLang.sName + @"\SYSTEM\system_sounds.txt");
|
||||
other_strings = System.IO.File.ReadAllLines(@"SOUNDS\" + curLang.sName + @"\other_sounds.txt");
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
system_strings = tables.default_system_strings[tables.toInt(curLang.sName)];
|
||||
other_strings = tables.default_other_strings[tables.toInt(curLang.sName)];
|
||||
}
|
||||
sentences.RemoveRange(0, sentences.Count);
|
||||
|
||||
foreach (string str in system_strings)
|
||||
sentences.Add(str);
|
||||
|
||||
sentences.Add(@";^ System Sounds ^;");
|
||||
|
||||
foreach (string str in other_strings)
|
||||
sentences.Add(str);
|
||||
|
||||
lvSentences.Items.Refresh(); // Workaround - Two way binding is better
|
||||
}
|
||||
|
||||
private void cbLanguages_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
curLang = (Language)e.AddedItems[0];
|
||||
loadLanguage();
|
||||
}
|
||||
|
||||
private void lvSentences_MouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (this.lvSentences.SelectedItems.Count < 1)
|
||||
return;
|
||||
|
||||
synth.SetOutputToDefaultAudioDevice();
|
||||
synth.Rate = (int)this.voiceRateSlider.Value;
|
||||
synth.Volume = (int)this.voiceVolumeSlider.Value;
|
||||
|
||||
Sentence sentence = (Sentence)this.lvSentences.SelectedItem;
|
||||
synth.SelectVoice(cbVoices.Text);
|
||||
try { synth.Speak(sentence.voiceString); }
|
||||
catch (Exception){} // Workaround - Some TTS engines crashes on destruction
|
||||
}
|
||||
|
||||
private void openTXLogo_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
AboutWindow aboutWindow = new AboutWindow();
|
||||
aboutWindow.ShowDialog();
|
||||
}
|
||||
|
||||
private void InstallVoices_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
InstallVoicesWindow installVoicesWindow = new InstallVoicesWindow();
|
||||
installVoicesWindow.ShowDialog();
|
||||
}
|
||||
|
||||
private void buttonPlay_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
lvSentences_MouseDoubleClick(sender, null);
|
||||
}
|
||||
|
||||
private void buttonAddItem_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
added_files++;
|
||||
sentences.Add(new Sentence("new_file_" + added_files.ToString() + ";New Description;New Voice Message"));
|
||||
this.lvSentences.Items.Refresh();
|
||||
this.lvSentences.SelectedIndex = this.lvSentences.Items.Count - 1;
|
||||
this.lvSentences.ScrollIntoView(this.lvSentences.SelectedItem);
|
||||
}
|
||||
|
||||
private void buttonSaveFiles_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Cursor oldCursor = this.Cursor;
|
||||
this.Cursor = Cursors.Wait;
|
||||
|
||||
synth.SelectVoice(cbVoices.Text);
|
||||
synth.Rate = (int)this.fileRateSlider.Value;
|
||||
synth.Volume = (int)this.fileVolumeSlider.Value;
|
||||
|
||||
int sampleRate = 32000;
|
||||
if ((bool)this.rb16khz.IsChecked)
|
||||
sampleRate = 16000;
|
||||
else if ((bool)this.rb8khz.IsChecked)
|
||||
sampleRate = 8000;
|
||||
|
||||
SpeechAudioFormatInfo audioFormat = new SpeechAudioFormatInfo(sampleRate, AudioBitsPerSample.Sixteen, AudioChannel.Mono);
|
||||
|
||||
System.IO.Directory.CreateDirectory(@"SOUNDS\" + curLang.sName + @"\SYSTEM");
|
||||
StreamWriter sw = File.CreateText(@"SOUNDS\" + curLang.sName + @"\SYSTEM\system_sounds.txt");
|
||||
int i;
|
||||
for (i = 0; sentences[i].fileName != ""; i++)
|
||||
{
|
||||
sw.WriteLine(sentences[i].toRaw());
|
||||
synth.SetOutputToWaveFile(@"SOUNDS\" + curLang.sName + @"\SYSTEM\" + sentences[i].fileName + ".wav", audioFormat);
|
||||
try { synth.Speak(sentences[i].voiceString); }
|
||||
catch (Exception){} // Workaround - Some TTS engines crashes on destruction
|
||||
}
|
||||
sw.Close();
|
||||
sw = File.CreateText(@"SOUNDS\" + curLang.sName + @"\other_sounds.txt");
|
||||
for (i++; i < sentences.Count; i++)
|
||||
{
|
||||
sw.WriteLine(sentences[i].toRaw());
|
||||
synth.SetOutputToWaveFile(@"SOUNDS\" + curLang.sName + @"\" + sentences[i].fileName + ".wav", audioFormat);
|
||||
try { synth.Speak(sentences[i].voiceString); }
|
||||
catch (Exception){} // Workaround - Some TTS engines crashes on destruction
|
||||
}
|
||||
sw.Close();
|
||||
synth.SetOutputToNull(); // Workaround - The synth does not release the sound file like it should
|
||||
this.Cursor = oldCursor;
|
||||
}
|
||||
}
|
||||
|
||||
public class Language
|
||||
{
|
||||
public string lName { get; set; }
|
||||
public string sName { get; set; }
|
||||
}
|
||||
|
||||
public class Languages : List<Language>
|
||||
{
|
||||
public void Add(string longer, string shorter)
|
||||
{
|
||||
this.Add(new Language { lName = longer, sName = shorter });
|
||||
}
|
||||
}
|
||||
|
||||
public class Sentence
|
||||
{
|
||||
public string fileName { get; set; }
|
||||
public string description { get; set; }
|
||||
public string voiceString { get; set; }
|
||||
|
||||
public Sentence(string rawString)
|
||||
{
|
||||
string[] words = rawString.Split(';');
|
||||
fileName = words[0].TrimStart(' ', '\"');
|
||||
description = words[1];
|
||||
voiceString = words[2].TrimEnd('\"', ',', ' ');
|
||||
}
|
||||
|
||||
public string toRaw()
|
||||
{
|
||||
return "\"" +fileName + ";" + description + ";" + voiceString + "\",";
|
||||
}
|
||||
}
|
||||
|
||||
public class Sentences : List<Sentence>
|
||||
{
|
||||
public void Add(string rawString)
|
||||
{
|
||||
this.Add(new Sentence(rawString));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,168 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{BB2C7ECA-B4B9-4957-B7D9-B0C7817CA148}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>OpenTXspeaker</RootNamespace>
|
||||
<AssemblyName>OpenTXspeaker</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>icon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Speech" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Xaml">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Compile Include="AboutWindow.xaml.cs">
|
||||
<DependentUpon>AboutWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="installvoices.xaml.cs">
|
||||
<DependentUpon>installvoices.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="sentencetables.cs" />
|
||||
<Page Include="installvoices.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Page Include="AboutWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<AppDesigner Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="eSpeak.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="icon.ico" />
|
||||
<Resource Include="speaker_logo.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="GPLv3_Logo.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual C# Express 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTXspeaker", "OpenTXspeaker.csproj", "{8143D08D-1861-42DD-A861-56B15DE42A69}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{8143D08D-1861-42DD-A861-56B15DE42A69}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{8143D08D-1861-42DD-A861-56B15DE42A69}.Debug|x86.Build.0 = Debug|x86
|
||||
{8143D08D-1861-42DD-A861-56B15DE42A69}.Release|x86.ActiveCfg = Release|x86
|
||||
{8143D08D-1861-42DD-A861-56B15DE42A69}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,71 +0,0 @@
|
||||
/* This file is part of OpenTX Speaker.
|
||||
* OpenTX Speaker 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* OpenTX Speaker 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.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with OpenTX Speaker. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Copyright 2014 Kjell Kernen */
|
||||
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("OpenTX Speaker")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("OpenTX Team")]
|
||||
[assembly: AssemblyProduct("OpenTX Speaker")]
|
||||
[assembly: AssemblyCopyright("Copyright © Kjell Kernen 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
//In order to begin building localizable applications, set
|
||||
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
||||
//inside a <PropertyGroup>. For example, if you are using US english
|
||||
//in your source files, set the <UICulture> to en-US. Then uncomment
|
||||
//the NeutralResourceLanguage attribute below. Update the "en-US" in
|
||||
//the line below to match the UICulture setting in the project file.
|
||||
|
||||
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
||||
|
||||
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
||||
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.3")]
|
||||
[assembly: AssemblyFileVersion("1.3")]
|
||||
@@ -1,63 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18444
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace OpenTXspeaker.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenTXspeaker.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,117 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -1,26 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18444
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace OpenTXspeaker.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -1,49 +0,0 @@
|
||||
<Window x:Class="OpenTXspeak.AboutWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="OpenTX About Window" Height="350" Width="357" Icon="/OpenTXspeaker;component/icon.ico">
|
||||
<Grid>
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel Orientation="Vertical">
|
||||
<StackPanel Orientation="Horizontal" Width="240" HorizontalAlignment="Left">
|
||||
<Label Content="Product:">
|
||||
</Label>
|
||||
<Label Content="Product Name" Name="lblProductName"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<Label Content="Version:"/>
|
||||
<Label Content="Version" Name="lblVersion"/>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<Label Content="Company:" />
|
||||
<Label Content="Company" Name="lblCompanyName"/>
|
||||
</StackPanel>
|
||||
<Label Content="Copyright" Name="lblCopyright" HorizontalAlignment="Left" />
|
||||
</StackPanel>
|
||||
<TextBlock>
|
||||
<Hyperlink NavigateUri="http://www.open-tx.org/" RequestNavigate="Hyperlink_RequestNavigate">
|
||||
<Image Stretch="Uniform" Height="90" Width="90" Cursor="Hand" Source="/OpenTXspeaker;component/icon.ico" />
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock Margin="5,5,5,0" TextWrapping="Wrap"
|
||||
Text="This application is used to edit OpenTX voice strings and generate audio files for use in the FrSky Taranis radio." />
|
||||
<TextBlock Margin="5,10,5,0" TextWrapping="Wrap"
|
||||
Text= "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 3 of the License, or any later version." />
|
||||
<TextBlock Margin="5,5,5,0" TextWrapping="Wrap"
|
||||
Text= "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." />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock TextWrapping="Wrap" Margin="5,5,5,0" Width="230"
|
||||
Text= "See the GNU General Public License for more details." />
|
||||
<TextBlock>
|
||||
<Hyperlink NavigateUri="http://www.gnu.org/licenses/" RequestNavigate="Hyperlink_RequestNavigate">
|
||||
<Image Width="88" Margin="0,5,0,0" Cursor="Hand" Source="/OpenTXspeaker;component/GPLv3_Logo.png" />
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -1,62 +0,0 @@
|
||||
/* This file is part of OpenTX Speaker.
|
||||
* OpenTX Speaker 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* OpenTX Speaker 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.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with OpenTX Speaker. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Copyright 2014 Kjell Kernen */
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using System.Windows.Navigation;
|
||||
|
||||
|
||||
namespace OpenTXspeak
|
||||
{
|
||||
public partial class AboutWindow : Window
|
||||
{
|
||||
public AboutWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
Assembly app = Assembly.GetExecutingAssembly();
|
||||
|
||||
AssemblyTitleAttribute title = (AssemblyTitleAttribute)app.GetCustomAttributes(typeof(AssemblyTitleAttribute), false)[0];
|
||||
AssemblyProductAttribute product = (AssemblyProductAttribute)app.GetCustomAttributes(typeof(AssemblyProductAttribute), false)[0];
|
||||
AssemblyCopyrightAttribute copyright = (AssemblyCopyrightAttribute)app.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false)[0];
|
||||
AssemblyCompanyAttribute company = (AssemblyCompanyAttribute)app.GetCustomAttributes(typeof(AssemblyCompanyAttribute), false)[0];
|
||||
Version version = app.GetName().Version;
|
||||
|
||||
this.Title = String.Format("About {0}", title.Title);
|
||||
this.lblProductName.Content = product.Product;
|
||||
this.lblVersion.Content = String.Format("Version {0}", version.ToString());
|
||||
this.lblCopyright.Content = copyright.Copyright.ToString();
|
||||
this.lblCompanyName.Content = company.Company;
|
||||
}
|
||||
|
||||
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
|
||||
{
|
||||
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 78 KiB |
@@ -1,24 +0,0 @@
|
||||
<Window x:Class="OpenTXspeak.InstallVoicesWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="Install Additional Voices" Height="269" Width="504" Icon="/OpenTXspeaker;component/icon.ico">
|
||||
<Grid>
|
||||
<StackPanel Orientation="Vertical" >
|
||||
<TextBlock Margin="5,5,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" TextWrapping="Wrap"
|
||||
Text="The English default voice (Microsoft Anna) is quite good. Microsoft does however not provide free voices for all languages. If there is no voice available for your language, you must install one on your own. Any MS SAPI voice should work."/>
|
||||
<TextBlock Margin="5,5,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" TextWrapping="Wrap"
|
||||
Text="Use the phrases SAPI and TTS to search for voices. TTS is the general term for synthetic speech and SAPI is Microsoft's voice interface." />
|
||||
<TextBlock Margin="5,5,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" TextWrapping="Wrap"
|
||||
Text="There are several commercial alternatives available. These are high quility, but also expensive. There are also free open source alternatives. The downside to these is that the voices sound robotic. But they are clearly understandable." />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Margin="5,5,10,0" Width="370" HorizontalAlignment="Left" VerticalAlignment="Top" TextWrapping="Wrap"
|
||||
Text="The author of this application used the free eSpeak voices to test voice generation. Many languages are supported. Click the image on the right to go to eSpeaks project page. There you can find out if your language is supported and download the voice package." />
|
||||
<TextBlock>
|
||||
<Hyperlink NavigateUri="http://espeak.sourceforge.net/" RequestNavigate="Hyperlink_RequestNavigate">
|
||||
<Image Stretch="None" Cursor="Hand" Source="/OpenTXspeaker;component/eSpeak.png" />
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -1,53 +0,0 @@
|
||||
/* This file is part of OpenTX Speaker.
|
||||
* OpenTX Speaker 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* OpenTX Speaker 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.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with OpenTX Speaker. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Copyright 2014 Kjell Kernen */
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using System.Windows.Navigation;
|
||||
|
||||
|
||||
|
||||
namespace OpenTXspeak
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for installvoices.xaml
|
||||
/// </summary>
|
||||
public partial class InstallVoicesWindow : Window
|
||||
{
|
||||
public InstallVoicesWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
|
||||
{
|
||||
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 4.2 KiB |