Skip to content

Commit

Permalink
openal audio and voice messages
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Sep 4, 2014
1 parent 90a9c92 commit 9bbc99a
Show file tree
Hide file tree
Showing 26 changed files with 1,292 additions and 221 deletions.
51 changes: 51 additions & 0 deletions MSVC.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,57 @@ or download in ZIP and extract to **D:\TBuild\Libraries\**, rename **libexif-0.6
* Build Debug configuration
* Build Release configuration

####OpenAL Soft

Get sources by git in [Git Bash](http://git-scm.com/downloads) go to **/d/tbuild/libraries** and run

git clone git://repo.or.cz/openal-soft.git

to have **D:\TBuild\Libraries\openal-soft\CMakeLists.txt**

#####Building library

* Install [CMake](http://www.cmake.org/)
* Go in **cmd** to **D:\TBuild\Libraries\openal-soft\build\**
* Run **cmake -G "Visual Studio 12 2013" -D LIBTYPE:STRING=STATIC ..**
* Open in VS2013 **D:\TBuild\Libraries\openal-soft\build\OpenAL.sln**
* For **Debug** configuration
* OpenAL32 Properties > C/C++ > Code Generation > Runtime Library = **Multi-threaded Debug (/MTd)****OK**
* common Properties > C/C++ > Code Generation > Runtime Library = **Multi-threaded Debug (/MTd)****OK**
* For **Release** configuration
* OpenAL32 Properties > C/C++ > Code Generation > Runtime Library = **Multi-threaded (/MT)****OK**
* common Properties > C/C++ > Code Generation > Runtime Library = **Multi-threaded (/MT)****OK**

####libogg 1.3.2

Get sources from http://xiph.org/downloads/ in [ZIP](http://downloads.xiph.org/releases/ogg/libogg-1.3.2.zip) and extract to **D:\TBuild\Libraries\**

#####Building library

* Open in VS2013 **D:\TBuild\Libraries\libogg-1.3.2\win32\VS2010\libogg_static.sln** > One-way upgrade – **OK**
* Build Debug configuration
* Build Release configuration

####Opus codec, opusfile

Get sources by git in [Git Bash](http://git-scm.com/downloads) go to **/d/tbuild/libraries** and run

git clone git://git.opus-codec.org/opus.git
git clone git://git.xiph.org/opusfile.git

to have **D:\TBuild\Libraries\opus\**

#####Building libraries

* Open in VS2013 **D:\TBuild\Libraries\opus\win32\VS2010\opus.sln** > One-way upgrade – **OK**
* Build Debug configuration
* Build Release configuration
* Open in VS2013 **D:\TBuild\Libraries\opusfile\win32\VS2010\opusfile.sln** > One-way upgrade – **OK**
* For **Debug** and **Release** configurations
* opusfile > C/C++ > General > Additional include directories > Add **../../../libogg-1.3.2/include;**
* Build Debug configuration
* Build Release configuration

####Qt 5.3.1, slightly patched

http://download.qt-project.org/official_releases/qt/5.3/5.3.1/single/qt-everywhere-opensource-src-5.3.1.zip
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ Source code is published under GPL v3, license is available [here](https://githu
* libexif 0.6.20 ([LGPL](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html))
* LZMA SDK 9.20 ([public domain](http://www.7-zip.org/sdk.html))
* liblzma ([public domain](http://tukaani.org/xz/))
* OpenAL Soft ([LGPL](http://kcat.strangesoft.net/openal.html))
* Opus codec, opusfile ([BSD license](http://www.opus-codec.org/license/))
* libogg ([BSD license](http://www.xiph.org/downloads/))
* Open Sans font ([Apache License](http://www.apache.org/licenses/LICENSE-2.0.html))
* DejaVu Sans font ([Free license](http://dejavu-fonts.org/wiki/License))

Expand Down
4 changes: 2 additions & 2 deletions Telegram/PrepareLinux.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AppVersionStr=0.5.17
AppVersion=5017
AppVersionStr=0.5.18
AppVersion=5018

if [ -d "./../Linux/Release/deploy/$AppVersionStr" ]; then
echo "Deploy folder for version $AppVersionStr already exists!"
Expand Down
4 changes: 2 additions & 2 deletions Telegram/PrepareLinux32.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AppVersionStr=0.5.17
AppVersion=5017
AppVersionStr=0.5.18
AppVersion=5018

if [ -d "./../Linux/Release/deploy/$AppVersionStr" ]; then
echo "Deploy folder for version $AppVersionStr already exists!"
Expand Down
4 changes: 2 additions & 2 deletions Telegram/PrepareMac.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AppVersionStr=0.5.17
AppVersion=5017
AppVersionStr=0.5.18
AppVersion=5018

if [ -d "./../Mac/Release/deploy/$AppVersionStr" ]; then
echo "Deploy folder for version $AppVersionStr already exists!"
Expand Down
4 changes: 4 additions & 0 deletions Telegram/Resources/style.txt
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,10 @@ mediaDocOutImg: sprite(6px, 146px, 48px, 48px);
mediaDocInImg: sprite(56px, 146px, 48px, 48px);
mediaAudioOutImg: sprite(106px, 146px, 48px, 48px);
mediaAudioInImg: sprite(156px, 146px, 48px, 48px);
mediaPlayOutImg: sprite(122px, 341px, 48px, 48px);
mediaPlayInImg: sprite(172px, 341px, 48px, 48px);
mediaPauseOutImg: sprite(222px, 341px, 48px, 48px);
mediaPauseInImg: sprite(272px, 341px, 48px, 48px);
mediaInColor: msgInDateColor;
mediaOutColor: msgOutDateColor;
mediaInSelectColor: msgInSelectDateColor;
Expand Down
6 changes: 3 additions & 3 deletions Telegram/Setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

#define MyAppShortName "Telegram"
#define MyAppName "Telegram Win (Unofficial)"
#define MyAppVersion "0.5.17"
#define MyAppVersionZero "0.5.17"
#define MyAppFullVersion "0.5.17.0"
#define MyAppVersion "0.5.18"
#define MyAppVersionZero "0.5.18"
#define MyAppFullVersion "0.5.18.0"
#define MyAppPublisher "Telegram (Unofficial)"
#define MyAppURL "https://tdesktop.com"
#define MyAppExeName "Telegram.exe"
Expand Down
18 changes: 5 additions & 13 deletions Telegram/SourceFiles/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ Copyright (c) 2014 John Preston, https://tdesktop.com

#include "app.h"

#include "audio.h"
#include "application.h"
#include "fileuploader.h"
#include "mainwidget.h"
#include <QtMultimedia/QSoundEffect>
#include <libexif/exif-data.h>

namespace {
Expand Down Expand Up @@ -61,7 +61,6 @@ namespace {

HistoryItem *hoveredItem = 0, *pressedItem = 0, *hoveredLinkItem = 0, *pressedLinkItem = 0, *contextItem = 0, *mousedItem = 0;

QSoundEffect *newMsgSound = 0;
QPixmap *sprite = 0, *emojis = 0;

typedef QMap<uint32, QPixmap> EmojisMap;
Expand Down Expand Up @@ -1245,11 +1244,7 @@ namespace App {

void initMedia() {
deinitMedia(false);
if (!newMsgSound) {
newMsgSound = new QSoundEffect();
newMsgSound->setSource(QUrl::fromLocalFile(st::newMsgSound));
newMsgSound->setVolume(1);
}
audioInit();

if (!::sprite) {
::sprite = new QPixmap(st::spriteFile);
Expand All @@ -1273,10 +1268,7 @@ namespace App {
histories().clear();

if (completely) {
LOG(("Deleting sound.."));
delete newMsgSound;
LOG(("Sound deleted!"));
newMsgSound = 0;
audioFinish();

delete ::sprite;
::sprite = 0;
Expand Down Expand Up @@ -1367,7 +1359,7 @@ namespace App {
}

void playSound() {
if (cSoundNotify() && newMsgSound) newMsgSound->play();
if (cSoundNotify()) audioPlayNotify();
}

void writeConfig() {
Expand Down Expand Up @@ -1741,7 +1733,7 @@ namespace App {
case dbinvShowName: cSetNotifyView(dbinvShowName); break;
default: cSetNotifyView(dbinvShowPreview); break;
}
}
} break;

case dbiAskDownloadPath: {
qint32 v;
Expand Down
Binary file modified Telegram/SourceFiles/art/sprite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Telegram/SourceFiles/art/sprite_200x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 9bbc99a

Please sign in to comment.