Compare commits
3 commits
31bed51455
...
dda2a9147a
Author | SHA1 | Date | |
---|---|---|---|
|
dda2a9147a | ||
|
d936663591 | ||
|
ac6999924f |
34 changed files with 140 additions and 160 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,6 +2,7 @@
|
||||||
.pylint.out
|
.pylint.out
|
||||||
*.pyc
|
*.pyc
|
||||||
*.pyo
|
*.pyo
|
||||||
|
*.bak
|
||||||
|
|
||||||
toxygen/toxcore
|
toxygen/toxcore
|
||||||
tests/tests
|
tests/tests
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
FROM ubuntu:16.04
|
|
||||||
|
|
||||||
RUN apt-get update && \
|
|
||||||
apt-get install build-essential libtool autotools-dev automake checkinstall cmake check git yasm libsodium-dev libopus-dev libvpx-dev pkg-config -y && \
|
|
||||||
git clone https://github.com/ingvar1995/toxcore.git --branch=ngc_rebase && \
|
|
||||||
cd toxcore && mkdir _build && cd _build && \
|
|
||||||
cmake .. && make && make install
|
|
||||||
|
|
||||||
RUN apt-get install portaudio19-dev python3-pyqt5 python3-pyaudio python3-pip -y && \
|
|
||||||
pip3 install numpy pydenticon opencv-python pyinstaller
|
|
||||||
|
|
||||||
RUN useradd -ms /bin/bash toxygen
|
|
||||||
USER toxygen
|
|
|
@ -1,33 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
cd ~
|
|
||||||
git clone https://github.com/toxygen-project/toxygen.git --branch=next_gen
|
|
||||||
cd toxygen/toxygen
|
|
||||||
|
|
||||||
pyinstaller --windowed --icon=images/icon.ico main.py
|
|
||||||
|
|
||||||
cp -r styles dist/main/
|
|
||||||
find . -type f ! -name '*.qss' -delete
|
|
||||||
cp -r plugins dist/main/
|
|
||||||
mkdir -p dist/main/ui/views
|
|
||||||
cp -r ui/views dist/main/ui/
|
|
||||||
cp -r sounds dist/main/
|
|
||||||
cp -r smileys dist/main/
|
|
||||||
cp -r stickers dist/main/
|
|
||||||
cp -r bootstrap dist/main/
|
|
||||||
find . -type f ! -name '*.json' -delete
|
|
||||||
cp -r images dist/main/
|
|
||||||
cp -r translations dist/main/
|
|
||||||
find . -name "*.ts" -type f -delete
|
|
||||||
|
|
||||||
cd dist
|
|
||||||
mv main toxygen
|
|
||||||
cd toxygen
|
|
||||||
mv main toxygen
|
|
||||||
wget -O updater https://github.com/toxygen-project/toxygen_updater/releases/download/v0.1/toxygen_updater_linux_64
|
|
||||||
echo "[Paths]" >> qt.conf
|
|
||||||
echo "Prefix = PyQt5/Qt" >> qt.conf
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
tar -zcvf toxygen_linux_64.tar.gz toxygen > /dev/null
|
|
||||||
rm -rf toxygen
|
|
|
@ -8,10 +8,11 @@ QtPy >= 2.4.1
|
||||||
PyAudio >= 0.2.13
|
PyAudio >= 0.2.13
|
||||||
numpy >= 1.26.1
|
numpy >= 1.26.1
|
||||||
opencv_python >= 4.8.0
|
opencv_python >= 4.8.0
|
||||||
pydenticon >= 0.3.1
|
|
||||||
pillow >= 10.2.0
|
pillow >= 10.2.0
|
||||||
gevent >= 23.9.1
|
gevent >= 23.9.1
|
||||||
|
pydenticon >= 0.3.1
|
||||||
greenlet >= 2.0.2
|
greenlet >= 2.0.2
|
||||||
|
sounddevice >= 0.3.15
|
||||||
# this is optional
|
# this is optional
|
||||||
coloredlogs >= 15.0.1
|
coloredlogs >= 15.0.1
|
||||||
# this is optional
|
# this is optional
|
||||||
|
|
|
@ -14,7 +14,7 @@ faulthandler.enable()
|
||||||
import warnings
|
import warnings
|
||||||
warnings.filterwarnings('ignore')
|
warnings.filterwarnings('ignore')
|
||||||
|
|
||||||
import tox_wrapper.tests.support_testing as ts
|
import toxygen_wrapper.tests.support_testing as ts
|
||||||
try:
|
try:
|
||||||
from trepan.interfaces import server as Mserver
|
from trepan.interfaces import server as Mserver
|
||||||
from trepan.api import debug
|
from trepan.api import debug
|
||||||
|
|
|
@ -38,7 +38,7 @@ from middleware import threads
|
||||||
import middleware.callbacks as callbacks
|
import middleware.callbacks as callbacks
|
||||||
import updater.updater as updater
|
import updater.updater as updater
|
||||||
from middleware.tox_factory import tox_factory
|
from middleware.tox_factory import tox_factory
|
||||||
import tox_wrapper.toxencryptsave as tox_encrypt_save
|
import toxygen_wrapper.toxencryptsave as tox_encrypt_save
|
||||||
import user_data.toxes
|
import user_data.toxes
|
||||||
from user_data import settings
|
from user_data import settings
|
||||||
from user_data.settings import get_user_config_path, merge_args_into_settings
|
from user_data.settings import get_user_config_path, merge_args_into_settings
|
||||||
|
@ -76,7 +76,7 @@ from ui.widgets_factory import WidgetsFactory
|
||||||
from user_data.backup_service import BackupService
|
from user_data.backup_service import BackupService
|
||||||
import styles.style # TODO: dynamic loading
|
import styles.style # TODO: dynamic loading
|
||||||
|
|
||||||
import tox_wrapper.tests.support_testing as ts
|
import toxygen_wrapper.tests.support_testing as ts
|
||||||
|
|
||||||
global LOG
|
global LOG
|
||||||
import logging
|
import logging
|
||||||
|
@ -114,7 +114,7 @@ def setup_logging(oArgs) -> None:
|
||||||
|
|
||||||
LOG.setLevel(oArgs.loglevel)
|
LOG.setLevel(oArgs.loglevel)
|
||||||
LOG.trace = lambda l: LOG.log(0, repr(l))
|
LOG.trace = lambda l: LOG.log(0, repr(l))
|
||||||
LOG.info(f"Setting loglevel to {oArgs.loglevel!s}")
|
LOG.info(f"Setting loglevel to {oArgs.loglevel}")
|
||||||
|
|
||||||
if oArgs.loglevel < 20:
|
if oArgs.loglevel < 20:
|
||||||
# opencv debug
|
# opencv debug
|
||||||
|
@ -164,7 +164,7 @@ class App:
|
||||||
setup_logging(oArgs)
|
setup_logging(oArgs)
|
||||||
# sys.stderr.write( 'Command line args: ' +repr(oArgs) +'\n')
|
# sys.stderr.write( 'Command line args: ' +repr(oArgs) +'\n')
|
||||||
LOG.info("Command line: " +' '.join(sys.argv[1:]))
|
LOG.info("Command line: " +' '.join(sys.argv[1:]))
|
||||||
LOG.debug(f'oArgs = {oArgs!r}')
|
LOG.debug(f'oArgs = {oArgs}')
|
||||||
LOG.info("Starting toxygen version " +version)
|
LOG.info("Starting toxygen version " +version)
|
||||||
|
|
||||||
self._version = version
|
self._version = version
|
||||||
|
@ -238,8 +238,8 @@ class App:
|
||||||
if self._uri is not None:
|
if self._uri is not None:
|
||||||
self._ms.add_contact(self._uri)
|
self._ms.add_contact(self._uri)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.error(f"Error loading profile: {e!s}")
|
LOG.error(f"Error loading profile: {e}")
|
||||||
sys.stderr.write(' iMain(): ' +f"Error loading profile: {e!s}" \
|
sys.stderr.write(' iMain(): ' +f"Error loading profile: {e}" \
|
||||||
+'\n' + traceback.format_exc()+'\n')
|
+'\n' + traceback.format_exc()+'\n')
|
||||||
util_ui.message_box(str(e),
|
util_ui.message_box(str(e),
|
||||||
util_ui.tr('Error loading profile'))
|
util_ui.tr('Error loading profile'))
|
||||||
|
@ -350,7 +350,7 @@ class App:
|
||||||
self._app.setStyleSheet(style)
|
self._app.setStyleSheet(style)
|
||||||
|
|
||||||
def _load_app_styles(self) -> None:
|
def _load_app_styles(self) -> None:
|
||||||
LOG.debug(f"_load_app_styles {list(settings.built_in_themes().keys())!r}")
|
LOG.debug(f"_load_app_styles {list(settings.built_in_themes().keys())}")
|
||||||
# application color scheme
|
# application color scheme
|
||||||
if self._settings['theme'] in ['', 'default']: return
|
if self._settings['theme'] in ['', 'default']: return
|
||||||
for theme in settings.built_in_themes().keys():
|
for theme in settings.built_in_themes().keys():
|
||||||
|
@ -478,7 +478,7 @@ class App:
|
||||||
# Threads
|
# Threads
|
||||||
|
|
||||||
def _start_threads(self, initial_start=True) -> None:
|
def _start_threads(self, initial_start=True) -> None:
|
||||||
LOG.debug(f"_start_threads before: {threading.enumerate()!r}")
|
LOG.debug(f"_start_threads before: {threading.enumerate()}")
|
||||||
# init thread
|
# init thread
|
||||||
self._init = threads.InitThread(self._tox,
|
self._init = threads.InitThread(self._tox,
|
||||||
self._plugin_loader,
|
self._plugin_loader,
|
||||||
|
@ -487,7 +487,7 @@ class App:
|
||||||
initial_start)
|
initial_start)
|
||||||
self._init.start()
|
self._init.start()
|
||||||
def te(): return [t.name for t in threading.enumerate()]
|
def te(): return [t.name for t in threading.enumerate()]
|
||||||
LOG.debug(f"_start_threads init: {te()!r}")
|
LOG.debug(f"_start_threads init: {te()}")
|
||||||
|
|
||||||
# starting threads for tox iterate and toxav iterate
|
# starting threads for tox iterate and toxav iterate
|
||||||
self._main_loop = threads.ToxIterateThread(self._tox, app=self)
|
self._main_loop = threads.ToxIterateThread(self._tox, app=self)
|
||||||
|
@ -498,7 +498,7 @@ class App:
|
||||||
|
|
||||||
if initial_start:
|
if initial_start:
|
||||||
threads.start_file_transfer_thread()
|
threads.start_file_transfer_thread()
|
||||||
LOG.debug(f"_start_threads after: {[t.name for t in threading.enumerate()]!r}")
|
LOG.debug(f"_start_threads after: {[t.name for t in threading.enumerate()]}")
|
||||||
|
|
||||||
def _stop_threads(self, is_app_closing=True) -> None:
|
def _stop_threads(self, is_app_closing=True) -> None:
|
||||||
LOG.debug("_stop_threads")
|
LOG.debug("_stop_threads")
|
||||||
|
@ -917,7 +917,7 @@ class App:
|
||||||
if status > 0:
|
if status > 0:
|
||||||
LOG.info(f"Connected # {i}" +' : ' +repr(status))
|
LOG.info(f"Connected # {i}" +' : ' +repr(status))
|
||||||
break
|
break
|
||||||
LOG.trace(f"Connected status #{i}: {status!r}")
|
LOG.trace(f"Connected status #{i}: {status}")
|
||||||
self.loop(2)
|
self.loop(2)
|
||||||
|
|
||||||
def _test_env(self) -> None:
|
def _test_env(self) -> None:
|
||||||
|
@ -995,7 +995,7 @@ class App:
|
||||||
self._ms.log_console()
|
self._ms.log_console()
|
||||||
|
|
||||||
def _test_main(self) -> None:
|
def _test_main(self) -> None:
|
||||||
from toxygen_tox_wrapper.tox_wrapper.tests.tests_wrapper import main as tests_main
|
from toxygen_toxygen_wrapper.toxygen_wrapper.tests.tests_wrapper import main as tests_main
|
||||||
LOG.debug("_test_main")
|
LOG.debug("_test_main")
|
||||||
if not self._tox: return
|
if not self._tox: return
|
||||||
title = 'Extended Test Suite'
|
title = 'Extended Test Suite'
|
||||||
|
|
|
@ -3,9 +3,9 @@ import time
|
||||||
import threading
|
import threading
|
||||||
import itertools
|
import itertools
|
||||||
|
|
||||||
from tox_wrapper.toxav_enums import *
|
from toxygen_wrapper.toxav_enums import *
|
||||||
from tox_wrapper.tests import support_testing as ts
|
from toxygen_wrapper.tests import support_testing as ts
|
||||||
from tox_wrapper.tests.support_testing import LOG_ERROR, LOG_WARN, LOG_INFO, LOG_DEBUG, LOG_TRACE
|
from toxygen_wrapper.tests.support_testing import LOG_ERROR, LOG_WARN, LOG_INFO, LOG_DEBUG, LOG_TRACE
|
||||||
|
|
||||||
with ts.ignoreStderr():
|
with ts.ignoreStderr():
|
||||||
import pyaudio
|
import pyaudio
|
||||||
|
@ -14,7 +14,7 @@ from av.call import Call
|
||||||
import common.tox_save
|
import common.tox_save
|
||||||
|
|
||||||
from utils import ui as util_ui
|
from utils import ui as util_ui
|
||||||
import tox_wrapper.tests.support_testing as ts
|
import toxygen_wrapper.tests.support_testing as ts
|
||||||
from middleware.threads import invoke_in_main_thread
|
from middleware.threads import invoke_in_main_thread
|
||||||
from middleware.threads import BaseThread
|
from middleware.threads import BaseThread
|
||||||
|
|
||||||
|
@ -38,10 +38,10 @@ class AV(common.tox_save.ToxAvSave):
|
||||||
s = settings
|
s = settings
|
||||||
if 'video' not in s:
|
if 'video' not in s:
|
||||||
LOG.warn("AV.__init__ 'video' not in s" )
|
LOG.warn("AV.__init__ 'video' not in s" )
|
||||||
LOG.debug(f"AV.__init__ {s!r}" )
|
LOG.debug(f"AV.__init__ {s}" )
|
||||||
elif 'device' not in s['video']:
|
elif 'device' not in s['video']:
|
||||||
LOG.warn("AV.__init__ 'device' not in s.video" )
|
LOG.warn("AV.__init__ 'device' not in s.video" )
|
||||||
LOG.debug(f"AV.__init__ {s['video']!r}" )
|
LOG.debug(f"AV.__init__ {s['video']}" )
|
||||||
|
|
||||||
self._calls = {} # dict: key - friend number, value - Call instance
|
self._calls = {} # dict: key - friend number, value - Call instance
|
||||||
|
|
||||||
|
@ -71,12 +71,15 @@ class AV(common.tox_save.ToxAvSave):
|
||||||
# was iOutput = self._settings._args.audio['output']
|
# was iOutput = self._settings._args.audio['output']
|
||||||
iInput = self._settings['audio']['input']
|
iInput = self._settings['audio']['input']
|
||||||
self.lPaSampleratesI = ts.lSdSamplerates(iInput)
|
self.lPaSampleratesI = ts.lSdSamplerates(iInput)
|
||||||
|
if not self.lPaSampleratesI: LOG.warn(f"empty self.lPaSampleratesI iInput={iInput}")
|
||||||
iOutput = self._settings['audio']['output']
|
iOutput = self._settings['audio']['output']
|
||||||
self.lPaSampleratesO = ts.lSdSamplerates(iOutput)
|
self.lPaSampleratesO = ts.lSdSamplerates(iOutput)
|
||||||
|
if not self.lPaSampleratesO: LOG.warn(f"empty self.lPaSampleratesO iOutput={iOutput}")
|
||||||
global oPYA
|
global oPYA
|
||||||
oPYA = self._audio = pyaudio.PyAudio()
|
oPYA = self._audio = pyaudio.PyAudio()
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
|
LOG_DEBUG(f"AV.CA stop {self._video_thread}")
|
||||||
self._running = False
|
self._running = False
|
||||||
self.stop_audio_thread()
|
self.stop_audio_thread()
|
||||||
self.stop_video_thread()
|
self.stop_video_thread()
|
||||||
|
@ -126,8 +129,7 @@ class AV(common.tox_save.ToxAvSave):
|
||||||
self._audio_krate_tox_audio if audio_enabled else 0,
|
self._audio_krate_tox_audio if audio_enabled else 0,
|
||||||
self._audio_krate_tox_video if video_enabled else 0)
|
self._audio_krate_tox_video if video_enabled else 0)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.debug(f"AV accept_call error from {friend_number} {self._running}" +
|
LOG.debug(f"AV accept_call error from {friend_number} {self._running} {e}")
|
||||||
f"{e}")
|
|
||||||
raise
|
raise
|
||||||
if audio_enabled:
|
if audio_enabled:
|
||||||
# may raise
|
# may raise
|
||||||
|
@ -194,26 +196,34 @@ class AV(common.tox_save.ToxAvSave):
|
||||||
LOG_WARN(f"start_audio_thread device={iInput}")
|
LOG_WARN(f"start_audio_thread device={iInput}")
|
||||||
return
|
return
|
||||||
LOG_DEBUG(f"start_audio_thread device={iInput}")
|
LOG_DEBUG(f"start_audio_thread device={iInput}")
|
||||||
lPaSamplerates = ts.lSdSamplerates(iInput)
|
lPaSamplerates = ts.lSdSamplerates(iInput)
|
||||||
if not(len(lPaSamplerates)):
|
if not(len(lPaSamplerates)):
|
||||||
e = f"No supported sample rates for device: audio[input]={iInput!r}"
|
e = f"No sample rates for device: audio[input]={iInput}"
|
||||||
LOG_ERROR(f"start_audio_thread {e}")
|
LOG_ERROR(f"start_audio_thread {e}")
|
||||||
#?? dunno - cancel call?
|
#?? dunno - cancel call? - no let the user do it
|
||||||
return
|
# return
|
||||||
if not self._audio_rate_pa in lPaSamplerates:
|
# just guessing here in case that's a false negative
|
||||||
LOG_WARN(f"{self._audio_rate_pa} not in {lPaSamplerates!r}")
|
lPaSamplerates = [round(oPYA.get_device_info_by_index(iInput)['defaultSampleRate'])]
|
||||||
if False:
|
if lPaSamplerates and self._audio_rate_pa in lPaSamplerates:
|
||||||
self._audio_rate_pa = oPYA.get_device_info_by_index(iInput)['defaultSampleRate']
|
pass
|
||||||
else:
|
elif lPaSamplerates:
|
||||||
LOG_WARN(f"Setting audio_rate to: {lPaSamplerates[0]}")
|
LOG_WARN(f"{self._audio_rate_pa} not in {lPaSamplerates}")
|
||||||
self._audio_rate_pa = lPaSamplerates[0]
|
self._audio_rate_pa = lPaSamplerates[0]
|
||||||
|
LOG_WARN(f"Setting audio_rate to: {lPaSamplerates[0]}")
|
||||||
|
elif 'defaultSampleRate' in oPYA.get_device_info_by_index(iInput):
|
||||||
|
self._audio_rate_pa = oPYA.get_device_info_by_index(iInput)['defaultSampleRate']
|
||||||
|
else:
|
||||||
|
LOG_WARN(f"{self._audio_rate_pa} not in {lPaSamplerates}")
|
||||||
|
# a float is in here - must it be int?
|
||||||
|
if type(self._audio_rate_pa) == float:
|
||||||
|
self._audio_rate_pa = round(self._audio_rate_pa)
|
||||||
try:
|
try:
|
||||||
LOG_DEBUG( f"start_audio_thread framerate: {self._audio_rate_pa}" \
|
LOG_DEBUG( f"start_audio_thread framerate: {self._audio_rate_pa}" \
|
||||||
+f" device: {iInput}"
|
+f" device: {iInput}"
|
||||||
+f" supported: {lPaSamplerates!r}")
|
+f" supported: {lPaSamplerates}")
|
||||||
if self._audio_rate_pa not in lPaSamplerates:
|
if self._audio_rate_pa not in lPaSamplerates:
|
||||||
LOG_WARN(f"PAudio sampling rate was {self._audio_rate_pa} changed to {lPaSamplerates[0]}")
|
LOG_WARN(f"PAudio sampling rate was {self._audio_rate_pa} changed to {lPaSamplerates[0]}")
|
||||||
|
LOG_DEBUG(f"lPaSamplerates={lPaSamplerates}")
|
||||||
self._audio_rate_pa = lPaSamplerates[0]
|
self._audio_rate_pa = lPaSamplerates[0]
|
||||||
|
|
||||||
if bSTREAM_CALLBACK:
|
if bSTREAM_CALLBACK:
|
||||||
|
@ -256,9 +266,10 @@ class AV(common.tox_save.ToxAvSave):
|
||||||
# raise RuntimeError(e)
|
# raise RuntimeError(e)
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
LOG_DEBUG(f"start_audio_thread {self._audio_stream!r}")
|
LOG_DEBUG(f"start_audio_thread {self._audio_stream}")
|
||||||
|
|
||||||
def stop_audio_thread(self):
|
def stop_audio_thread(self):
|
||||||
|
LOG_DEBUG(f"stop_audio_thread {self._audio_stream}")
|
||||||
|
|
||||||
if self._audio_thread is None:
|
if self._audio_thread is None:
|
||||||
return
|
return
|
||||||
|
@ -279,11 +290,11 @@ class AV(common.tox_save.ToxAvSave):
|
||||||
s = self._settings
|
s = self._settings
|
||||||
if 'video' not in s:
|
if 'video' not in s:
|
||||||
LOG.warn("AV.__init__ 'video' not in s" )
|
LOG.warn("AV.__init__ 'video' not in s" )
|
||||||
LOG.debug(f"start_video_thread {s!r}" )
|
LOG.debug(f"start_video_thread {s}" )
|
||||||
raise RuntimeError("start_video_thread not 'video' in s)" )
|
raise RuntimeError("start_video_thread not 'video' in s)" )
|
||||||
elif 'device' not in s['video']:
|
elif 'device' not in s['video']:
|
||||||
LOG.error("start_video_thread not 'device' in s['video']" )
|
LOG.error("start_video_thread not 'device' in s['video']" )
|
||||||
LOG.debug(f"start_video_thread {s['video']!r}" )
|
LOG.debug(f"start_video_thread {s['video']}" )
|
||||||
raise RuntimeError("start_video_thread not 'device' ins s['video']" )
|
raise RuntimeError("start_video_thread not 'device' ins s['video']" )
|
||||||
self._video_width = s['video']['width']
|
self._video_width = s['video']['width']
|
||||||
self._video_height = s['video']['height']
|
self._video_height = s['video']['height']
|
||||||
|
@ -321,6 +332,7 @@ class AV(common.tox_save.ToxAvSave):
|
||||||
self._video_thread.start()
|
self._video_thread.start()
|
||||||
|
|
||||||
def stop_video_thread(self) -> None:
|
def stop_video_thread(self) -> None:
|
||||||
|
LOG_DEBUG(f"stop_video_thread {self._video_thread}")
|
||||||
if self._video_thread is None:
|
if self._video_thread is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -331,7 +343,6 @@ class AV(common.tox_save.ToxAvSave):
|
||||||
try:
|
try:
|
||||||
if not self._video_thread.is_alive(): break
|
if not self._video_thread.is_alive(): break
|
||||||
except:
|
except:
|
||||||
# AttributeError: 'NoneType' object has no attribute 'join'
|
|
||||||
break
|
break
|
||||||
i = i + 1
|
i = i + 1
|
||||||
else:
|
else:
|
||||||
|
@ -349,12 +360,20 @@ class AV(common.tox_save.ToxAvSave):
|
||||||
if self._out_stream is None:
|
if self._out_stream is None:
|
||||||
# was iOutput = self._settings._args.audio['output']
|
# was iOutput = self._settings._args.audio['output']
|
||||||
iOutput = self._settings['audio']['output']
|
iOutput = self._settings['audio']['output']
|
||||||
if not rate in self.lPaSampleratesO:
|
if self.lPaSampleratesO and rate in self.lPaSampleratesO:
|
||||||
LOG.warn(f"{rate} not in {self.lPaSampleratesO!r}")
|
pass
|
||||||
if False:
|
elif self.lPaSampleratesO:
|
||||||
rate = oPYA.get_device_info_by_index(iOutput)['defaultSampleRate']
|
LOG.warn(f"{rate} not in {self.lPaSampleratesO}")
|
||||||
LOG.warn(f"Setting audio_rate to: {self.lPaSampleratesO[0]}")
|
LOG.warn(f"Setting audio_rate to: {self.lPaSampleratesO[0]}")
|
||||||
rate = self.lPaSampleratesO[0]
|
rate = self.lPaSampleratesO[0]
|
||||||
|
elif 'defaultSampleRate' in oPYA.get_device_info_by_index(iOutput):
|
||||||
|
rate = round(oPYA.get_device_info_by_index(iOutput)['defaultSampleRate'])
|
||||||
|
LOG.warn(f"Setting rate to {rate} empty self.lPaSampleratesO")
|
||||||
|
else:
|
||||||
|
LOG.warn(f"Using rate {rate} empty self.lPaSampleratesO")
|
||||||
|
if type(rate) == float:
|
||||||
|
rate = round(rate)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with ts.ignoreStderr():
|
with ts.ignoreStderr():
|
||||||
self._out_stream = oPYA.open(format=pyaudio.paInt16,
|
self._out_stream = oPYA.open(format=pyaudio.paInt16,
|
||||||
|
@ -372,7 +391,7 @@ class AV(common.tox_save.ToxAvSave):
|
||||||
return
|
return
|
||||||
|
|
||||||
iOutput = self._settings['audio']['output']
|
iOutput = self._settings['audio']['output']
|
||||||
LOG.debug(f"audio_chunk output_device_index={iOutput} rate={rate} channels={channels_count}")
|
#trace LOG.debug(f"audio_chunk output_device_index={iOutput} rate={rate} channels={channels_count}")
|
||||||
self._out_stream.write(samples)
|
self._out_stream.write(samples)
|
||||||
|
|
||||||
# AV sending
|
# AV sending
|
||||||
|
@ -389,7 +408,6 @@ class AV(common.tox_save.ToxAvSave):
|
||||||
for friend_num in self._calls:
|
for friend_num in self._calls:
|
||||||
if self._calls[friend_num].out_audio:
|
if self._calls[friend_num].out_audio:
|
||||||
try:
|
try:
|
||||||
# app.av.calls ERROR Error send_audio: One of the frame parameters was invalid. E.g. the resolution may be too small or too large, or the audio sampling rate may be unsupported
|
|
||||||
# app.av.calls ERROR Error send_audio audio_send_frame: This client is currently not in a call with the friend.
|
# app.av.calls ERROR Error send_audio audio_send_frame: This client is currently not in a call with the friend.
|
||||||
self._toxav.audio_send_frame(friend_num,
|
self._toxav.audio_send_frame(friend_num,
|
||||||
pcm,
|
pcm,
|
||||||
|
@ -402,7 +420,8 @@ class AV(common.tox_save.ToxAvSave):
|
||||||
# invoke_in_main_thread(util_ui.message_box,
|
# invoke_in_main_thread(util_ui.message_box,
|
||||||
# str(e),
|
# str(e),
|
||||||
# util_ui.tr("Error send_audio audio_send_frame"))
|
# util_ui.tr("Error send_audio audio_send_frame"))
|
||||||
pass
|
# raise #? stop ? endcall?
|
||||||
|
self.stop_audio_thread()
|
||||||
|
|
||||||
def send_audio(self) -> None:
|
def send_audio(self) -> None:
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
|
import traceback
|
||||||
|
|
||||||
import av.calls
|
import av.calls
|
||||||
from messenger.messages import *
|
from messenger.messages import *
|
||||||
|
@ -88,7 +89,9 @@ class CallsManager:
|
||||||
try:
|
try:
|
||||||
self._callav.call_accept_call(friend_number, audio, video)
|
self._callav.call_accept_call(friend_number, audio, video)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
#
|
||||||
LOG.error(f"accept_call _call.accept_call ERROR for {friend_number} {e}")
|
LOG.error(f"accept_call _call.accept_call ERROR for {friend_number} {e}")
|
||||||
|
LOG.debug(traceback.print_exc())
|
||||||
self._main_screen.call_finished()
|
self._main_screen.call_finished()
|
||||||
if hasattr(self._main_screen, '_settings') and \
|
if hasattr(self._main_screen, '_settings') and \
|
||||||
'audio' in self._main_screen._settings and \
|
'audio' in self._main_screen._settings and \
|
||||||
|
@ -100,11 +103,11 @@ class CallsManager:
|
||||||
elif hasattr(self._main_screen, '_settings') and \
|
elif hasattr(self._main_screen, '_settings') and \
|
||||||
hasattr(self._main_screen._settings, 'audio') and \
|
hasattr(self._main_screen._settings, 'audio') and \
|
||||||
'input' not in self._main_screen._settings['audio']:
|
'input' not in self._main_screen._settings['audio']:
|
||||||
LOG.warn(f"'audio' not in {self._main_screen._settings!r}")
|
LOG.warn(f"'audio' not in {self._main_screen._settings}")
|
||||||
elif hasattr(self._main_screen, '_settings') and \
|
elif hasattr(self._main_screen, '_settings') and \
|
||||||
hasattr(self._main_screen._settings, 'audio') and \
|
hasattr(self._main_screen._settings, 'audio') and \
|
||||||
'input' not in self._main_screen._settings['audio']:
|
'input' not in self._main_screen._settings['audio']:
|
||||||
LOG.warn(f"'audio' not in {self._main_screen._settings!r}")
|
LOG.warn(f"'audio' not in {self._main_screen._settings}")
|
||||||
else:
|
else:
|
||||||
LOG.warn(f"_settings not in self._main_screen")
|
LOG.warn(f"_settings not in self._main_screen")
|
||||||
util_ui.message_box(str(e),
|
util_ui.message_box(str(e),
|
||||||
|
|
|
@ -11,9 +11,9 @@ except ImportError:
|
||||||
certifi = None
|
certifi = None
|
||||||
|
|
||||||
from user_data.settings import get_user_config_path
|
from user_data.settings import get_user_config_path
|
||||||
from tox_wrapper.tests.support_testing import _get_nodes_path
|
from toxygen_wrapper.tests.support_testing import _get_nodes_path
|
||||||
from tox_wrapper.tests.support_http import download_url
|
from toxygen_wrapper.tests.support_http import download_url
|
||||||
import tox_wrapper.tests.support_testing as ts
|
import toxygen_wrapper.tests.support_testing as ts
|
||||||
|
|
||||||
global LOG
|
global LOG
|
||||||
import logging
|
import logging
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# -*- mode: python; indent-tabs-mode: nil; py-indent-offset: 4; coding: utf-8 -*-
|
# -*- mode: python; indent-tabs-mode: nil; py-indent-offset: 4; coding: utf-8 -*-
|
||||||
from user_data.settings import *
|
from user_data.settings import *
|
||||||
from qtpy import QtCore, QtGui
|
from qtpy import QtCore, QtGui
|
||||||
from tox_wrapper.toxcore_enums_and_consts import TOX_PUBLIC_KEY_SIZE
|
from toxygen_wrapper.toxcore_enums_and_consts import TOX_PUBLIC_KEY_SIZE
|
||||||
import utils.util as util
|
import utils.util as util
|
||||||
import common.event as event
|
import common.event as event
|
||||||
import contacts.common as common
|
import contacts.common as common
|
||||||
|
|
|
@ -146,7 +146,7 @@ class Contact(basecontact.BaseContact):
|
||||||
message.mark_as_sent()
|
message.mark_as_sent()
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
# wrapped C/C++ object of type QLabel has been deleted
|
# wrapped C/C++ object of type QLabel has been deleted
|
||||||
LOG.error(f"Mark as sent: {ex!s}")
|
LOG.error(f"Mark as sent: {ex}")
|
||||||
|
|
||||||
# Message deletion
|
# Message deletion
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
from qtpy import QtWidgets
|
from qtpy import QtWidgets
|
||||||
|
|
||||||
import utils.ui as util_ui
|
import utils.ui as util_ui
|
||||||
from tox_wrapper.toxcore_enums_and_consts import *
|
from toxygen_wrapper.toxcore_enums_and_consts import *
|
||||||
|
|
||||||
global LOG
|
global LOG
|
||||||
import logging
|
import logging
|
||||||
|
|
|
@ -9,7 +9,7 @@ from common.tox_save import ToxSave
|
||||||
from contacts.group_peer_contact import GroupPeerContact
|
from contacts.group_peer_contact import GroupPeerContact
|
||||||
from groups.group_peer import GroupChatPeer
|
from groups.group_peer import GroupChatPeer
|
||||||
from middleware.callbacks import LOG_ERROR, LOG_WARN, LOG_INFO, LOG_DEBUG, LOG_TRACE
|
from middleware.callbacks import LOG_ERROR, LOG_WARN, LOG_INFO, LOG_DEBUG, LOG_TRACE
|
||||||
import tox_wrapper.toxcore_enums_and_consts as enums
|
import toxygen_wrapper.toxcore_enums_and_consts as enums
|
||||||
|
|
||||||
# LOG=util.log
|
# LOG=util.log
|
||||||
global LOG
|
global LOG
|
||||||
|
|
|
@ -4,7 +4,7 @@ from contacts import contact
|
||||||
from contacts.contact_menu import GroupMenuGenerator
|
from contacts.contact_menu import GroupMenuGenerator
|
||||||
import utils.util as util
|
import utils.util as util
|
||||||
from groups.group_peer import GroupChatPeer
|
from groups.group_peer import GroupChatPeer
|
||||||
from tox_wrapper import toxcore_enums_and_consts as constants
|
from toxygen_wrapper import toxcore_enums_and_consts as constants
|
||||||
from common.tox_save import ToxSave
|
from common.tox_save import ToxSave
|
||||||
from groups.group_ban import GroupBan
|
from groups.group_ban import GroupBan
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
from contacts.group_chat import GroupChat
|
from contacts.group_chat import GroupChat
|
||||||
from common.tox_save import ToxSave
|
from common.tox_save import ToxSave
|
||||||
import tox_wrapper.toxcore_enums_and_consts as constants
|
import toxygen_wrapper.toxcore_enums_and_consts as constants
|
||||||
|
|
||||||
global LOG
|
global LOG
|
||||||
import logging
|
import logging
|
||||||
|
|
|
@ -96,8 +96,8 @@ class Profile(basecontact.BaseContact, tox_save.ToxSave):
|
||||||
self._timer.start()
|
self._timer.start()
|
||||||
|
|
||||||
# Current thread 0x00007901a13ccb80 (most recent call first):
|
# Current thread 0x00007901a13ccb80 (most recent call first):
|
||||||
# File "/usr/local/lib/python3.11/site-packages/tox_wrapper/tox.py", line 826 in self_get_friend_list_size
|
# File "/usr/local/lib/python3.11/site-packages/toxygen_wrapper/tox.py", line 826 in self_get_friend_list_size
|
||||||
# File "/usr/local/lib/python3.11/site-packages/tox_wrapper/tox.py", line 838 in self_get_friend_list
|
# File "/usr/local/lib/python3.11/site-packages/toxygen_wrapper/tox.py", line 838 in self_get_friend_list
|
||||||
# File "/mnt/o/var/local/src/toxygen/toxygen/contacts/contact_provider.py", line 45 in get_all_friends
|
# File "/mnt/o/var/local/src/toxygen/toxygen/contacts/contact_provider.py", line 45 in get_all_friends
|
||||||
# File "/mnt/o/var/local/src/toxygen/toxygen/contacts/profile.py", line 90 in _reconnect
|
# File "/mnt/o/var/local/src/toxygen/toxygen/contacts/profile.py", line 90 in _reconnect
|
||||||
# File "/usr/lib/python3.11/threading.py", line 1401 in run
|
# File "/usr/lib/python3.11/threading.py", line 1401 in run
|
||||||
|
|
|
@ -5,8 +5,8 @@ from time import time
|
||||||
|
|
||||||
from common.event import Event
|
from common.event import Event
|
||||||
from middleware.threads import invoke_in_main_thread
|
from middleware.threads import invoke_in_main_thread
|
||||||
from tox_wrapper.tox import Tox
|
from toxygen_wrapper.tox import Tox
|
||||||
from tox_wrapper.toxcore_enums_and_consts import TOX_FILE_KIND, TOX_FILE_CONTROL
|
from toxygen_wrapper.toxcore_enums_and_consts import TOX_FILE_KIND, TOX_FILE_CONTROL
|
||||||
from middleware.callbacks import LOG_ERROR, LOG_WARN, LOG_INFO, LOG_DEBUG, LOG_TRACE
|
from middleware.callbacks import LOG_ERROR, LOG_WARN, LOG_INFO, LOG_DEBUG, LOG_TRACE
|
||||||
|
|
||||||
FILE_TRANSFER_STATE = {
|
FILE_TRANSFER_STATE = {
|
||||||
|
|
|
@ -4,9 +4,9 @@ import common.tox_save as tox_save
|
||||||
import utils.ui as util_ui
|
import utils.ui as util_ui
|
||||||
from groups.peers_list import PeersListGenerator
|
from groups.peers_list import PeersListGenerator
|
||||||
from groups.group_invite import GroupInvite
|
from groups.group_invite import GroupInvite
|
||||||
import tox_wrapper.toxcore_enums_and_consts as constants
|
import toxygen_wrapper.toxcore_enums_and_consts as constants
|
||||||
from tox_wrapper.toxcore_enums_and_consts import *
|
from toxygen_wrapper.toxcore_enums_and_consts import *
|
||||||
from tox_wrapper.tox import UINT32_MAX
|
from toxygen_wrapper.tox import UINT32_MAX
|
||||||
|
|
||||||
global LOG
|
global LOG
|
||||||
import logging
|
import logging
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from ui.group_peers_list import PeerItem, PeerTypeItem
|
from ui.group_peers_list import PeerItem, PeerTypeItem
|
||||||
from tox_wrapper.toxcore_enums_and_consts import *
|
from toxygen_wrapper.toxcore_enums_and_consts import *
|
||||||
from ui.widgets import *
|
from ui.widgets import *
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@ import common.tox_save as tox_save
|
||||||
import utils.ui as util_ui
|
import utils.ui as util_ui
|
||||||
|
|
||||||
from messenger.messages import *
|
from messenger.messages import *
|
||||||
from tox_wrapper.tests.support_testing import assert_main_thread
|
from toxygen_wrapper.tests.support_testing import assert_main_thread
|
||||||
from tox_wrapper.toxcore_enums_and_consts import TOX_MAX_MESSAGE_LENGTH
|
from toxygen_wrapper.toxcore_enums_and_consts import TOX_MAX_MESSAGE_LENGTH
|
||||||
|
|
||||||
global LOG
|
global LOG
|
||||||
import logging
|
import logging
|
||||||
|
|
|
@ -3,9 +3,9 @@ import sys
|
||||||
import os
|
import os
|
||||||
import threading
|
import threading
|
||||||
from qtpy import QtGui
|
from qtpy import QtGui
|
||||||
from tox_wrapper.toxcore_enums_and_consts import *
|
from toxygen_wrapper.toxcore_enums_and_consts import *
|
||||||
from tox_wrapper.toxav_enums import *
|
from toxygen_wrapper.toxav_enums import *
|
||||||
from tox_wrapper.tox import bin_to_string
|
from toxygen_wrapper.tox import bin_to_string
|
||||||
import utils.ui as util_ui
|
import utils.ui as util_ui
|
||||||
import utils.util as util
|
import utils.util as util
|
||||||
from middleware.threads import invoke_in_main_thread, execute
|
from middleware.threads import invoke_in_main_thread, execute
|
||||||
|
@ -582,7 +582,7 @@ def group_peer_name(contacts_provider, groups_service):
|
||||||
else:
|
else:
|
||||||
# FixMe: known signal to revalidate roles...
|
# FixMe: known signal to revalidate roles...
|
||||||
#_peers = [(p._name, p._peer_id) for p in group.get_peers()]
|
#_peers = [(p._name, p._peer_id) for p in group.get_peers()]
|
||||||
LOG_TRACE(f"remove_peer group {group!r} has no peer_id={peer_id} in _peers!r")
|
LOG_TRACE(f"remove_peer group {group} has no peer_id={peer_id} in _peers!r")
|
||||||
return
|
return
|
||||||
|
|
||||||
return wrapped
|
return wrapped
|
||||||
|
@ -597,7 +597,7 @@ def group_peer_status(contacts_provider, groups_service):
|
||||||
peer.status = peer_status
|
peer.status = peer_status
|
||||||
else:
|
else:
|
||||||
# _peers = [(p._name, p._peer_id) for p in group.get_peers()]
|
# _peers = [(p._name, p._peer_id) for p in group.get_peers()]
|
||||||
LOG_TRACE(f"remove_peer group {group!r} has no peer_id={peer_id} in _peers!r")
|
LOG_TRACE(f"remove_peer group {group} has no peer_id={peer_id} in _peers!r")
|
||||||
# TODO: add info message
|
# TODO: add info message
|
||||||
invoke_in_main_thread(groups_service.generate_peers_list)
|
invoke_in_main_thread(groups_service.generate_peers_list)
|
||||||
|
|
||||||
|
@ -613,7 +613,7 @@ def group_topic(contacts_provider):
|
||||||
invoke_in_main_thread(group.set_status_message, topic)
|
invoke_in_main_thread(group.set_status_message, topic)
|
||||||
else:
|
else:
|
||||||
_peers = [(p._name, p._peer_id) for p in group.get_peers()]
|
_peers = [(p._name, p._peer_id) for p in group.get_peers()]
|
||||||
LOG_WARN(f"group_topic {group!r} has no peer_id={peer_id} in {_peers!r}")
|
LOG_WARN(f"group_topic {group} has no peer_id={peer_id} in {_peers}")
|
||||||
# TODO: add info message
|
# TODO: add info message
|
||||||
|
|
||||||
return wrapped
|
return wrapped
|
||||||
|
@ -627,7 +627,7 @@ def group_moderation(groups_service, contacts_provider, contacts_manager, messen
|
||||||
else:
|
else:
|
||||||
# FixMe: known signal to revalidate roles...
|
# FixMe: known signal to revalidate roles...
|
||||||
# _peers = [(p._name, p._peer_id) for p in group.get_peers()]
|
# _peers = [(p._name, p._peer_id) for p in group.get_peers()]
|
||||||
LOG_TRACE(f"update_peer_role group {group!r} has no peer_id={peer_id} in _peers!r")
|
LOG_TRACE(f"update_peer_role group {group} has no peer_id={peer_id} in _peers!r")
|
||||||
# TODO: add info message
|
# TODO: add info message
|
||||||
|
|
||||||
def remove_peer(group, mod_peer_id, peer_id, is_ban):
|
def remove_peer(group, mod_peer_id, peer_id, is_ban):
|
||||||
|
@ -638,7 +638,7 @@ def group_moderation(groups_service, contacts_provider, contacts_manager, messen
|
||||||
else:
|
else:
|
||||||
# FixMe: known signal to revalidate roles...
|
# FixMe: known signal to revalidate roles...
|
||||||
#_peers = [(p._name, p._peer_id) for p in group.get_peers()]
|
#_peers = [(p._name, p._peer_id) for p in group.get_peers()]
|
||||||
LOG_TRACE(f"remove_peer group {group!r} has no peer_id={peer_id} in _peers!r")
|
LOG_TRACE(f"remove_peer group {group} has no peer_id={peer_id} in _peers!r")
|
||||||
# TODO: add info message
|
# TODO: add info message
|
||||||
|
|
||||||
# source_peer_number, target_peer_number,
|
# source_peer_number, target_peer_number,
|
||||||
|
@ -651,13 +651,13 @@ def group_moderation(groups_service, contacts_provider, contacts_manager, messen
|
||||||
mod_peer = group.get_peer_by_id(mod_peer_id)
|
mod_peer = group.get_peer_by_id(mod_peer_id)
|
||||||
if not mod_peer:
|
if not mod_peer:
|
||||||
#_peers = [(p._name, p._peer_id) for p in group.get_peers()]
|
#_peers = [(p._name, p._peer_id) for p in group.get_peers()]
|
||||||
LOG_TRACE(f"remove_peer group {group!r} has no mod_peer_id={mod_peer_id} in _peers!r")
|
LOG_TRACE(f"remove_peer group {group} has no mod_peer_id={mod_peer_id} in _peers!r")
|
||||||
return
|
return
|
||||||
peer = group.get_peer_by_id(peer_id)
|
peer = group.get_peer_by_id(peer_id)
|
||||||
if not peer:
|
if not peer:
|
||||||
# FixMe: known signal to revalidate roles...
|
# FixMe: known signal to revalidate roles...
|
||||||
#_peers = [(p._name, p._peer_id) for p in group.get_peers()]
|
#_peers = [(p._name, p._peer_id) for p in group.get_peers()]
|
||||||
LOG_TRACE(f"remove_peer group {group!r} has no peer_id={peer_id} in _peers!r")
|
LOG_TRACE(f"remove_peer group {group} has no peer_id={peer_id} in _peers!r")
|
||||||
return
|
return
|
||||||
|
|
||||||
if event_type == TOX_GROUP_MOD_EVENT['KICK']:
|
if event_type == TOX_GROUP_MOD_EVENT['KICK']:
|
||||||
|
|
|
@ -6,8 +6,8 @@ from qtpy import QtCore
|
||||||
|
|
||||||
from bootstrap.bootstrap import *
|
from bootstrap.bootstrap import *
|
||||||
from bootstrap.bootstrap import download_nodes_list
|
from bootstrap.bootstrap import download_nodes_list
|
||||||
from tox_wrapper.toxcore_enums_and_consts import TOX_USER_STATUS, TOX_CONNECTION
|
from toxygen_wrapper.toxcore_enums_and_consts import TOX_USER_STATUS, TOX_CONNECTION
|
||||||
import tox_wrapper.tests.support_testing as ts
|
import toxygen_wrapper.tests.support_testing as ts
|
||||||
from utils import util
|
from utils import util
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
@ -86,7 +86,7 @@ class InitThread(BaseThread):
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
# DBUG+ InitThread run: ERROR name 'ts' is not defined
|
# DBUG+ InitThread run: ERROR name 'ts' is not defined
|
||||||
import tox_wrapper.tests.support_testing as ts
|
import toxygen_wrapper.tests.support_testing as ts
|
||||||
LOG_DEBUG('InitThread run: ')
|
LOG_DEBUG('InitThread run: ')
|
||||||
try:
|
try:
|
||||||
if self._is_first_start and ts.bAreWeConnected() and \
|
if self._is_first_start and ts.bAreWeConnected() and \
|
||||||
|
|
|
@ -6,12 +6,12 @@ import os
|
||||||
from ctypes import *
|
from ctypes import *
|
||||||
|
|
||||||
import user_data.settings
|
import user_data.settings
|
||||||
import tox_wrapper.tox
|
import toxygen_wrapper.tox
|
||||||
import tox_wrapper.toxcore_enums_and_consts as enums
|
import toxygen_wrapper.toxcore_enums_and_consts as enums
|
||||||
from tox_wrapper.tests import support_testing as ts
|
from toxygen_wrapper.tests import support_testing as ts
|
||||||
# callbacks can be called in any thread so were being careful
|
# callbacks can be called in any thread so were being careful
|
||||||
# tox.py can be called by callbacks
|
# tox.py can be called by callbacks
|
||||||
from tox_wrapper.tests.support_testing import LOG_ERROR, LOG_WARN, LOG_INFO, LOG_DEBUG, LOG_TRACE
|
from toxygen_wrapper.tests.support_testing import LOG_ERROR, LOG_WARN, LOG_INFO, LOG_DEBUG, LOG_TRACE
|
||||||
|
|
||||||
global LOG
|
global LOG
|
||||||
import logging
|
import logging
|
||||||
|
@ -34,7 +34,7 @@ def tox_factory(data=None, settings=None, args=None, app=None):
|
||||||
user_data.settings.clean_settings(settings)
|
user_data.settings.clean_settings(settings)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
tox_options = tox_wrapper.tox.Tox.options_new()
|
tox_options = toxygen_wrapper.tox.Tox.options_new()
|
||||||
tox_options.contents.ipv6_enabled = settings['ipv6_enabled']
|
tox_options.contents.ipv6_enabled = settings['ipv6_enabled']
|
||||||
tox_options.contents.udp_enabled = settings['udp_enabled']
|
tox_options.contents.udp_enabled = settings['udp_enabled']
|
||||||
tox_options.contents.proxy_type = int(settings['proxy_type'])
|
tox_options.contents.proxy_type = int(settings['proxy_type'])
|
||||||
|
@ -65,7 +65,7 @@ def tox_factory(data=None, settings=None, args=None, app=None):
|
||||||
tox_options.contents.ipv6_enabled = False
|
tox_options.contents.ipv6_enabled = False
|
||||||
tox_options.contents.hole_punching_enabled = False
|
tox_options.contents.hole_punching_enabled = False
|
||||||
|
|
||||||
LOG.debug("tox_wrapper.tox.Tox settings: " +repr(settings))
|
LOG.debug("toxygen_wrapper.tox.Tox settings: " +repr(settings))
|
||||||
|
|
||||||
if 'trace_enabled' in settings and not settings['trace_enabled']:
|
if 'trace_enabled' in settings and not settings['trace_enabled']:
|
||||||
LOG_DEBUG("settings['trace_enabled' disabled" )
|
LOG_DEBUG("settings['trace_enabled' disabled" )
|
||||||
|
@ -76,14 +76,14 @@ def tox_factory(data=None, settings=None, args=None, app=None):
|
||||||
else:
|
else:
|
||||||
LOG_WARN("No tox_options._options_pointer to add self_logger_cb" )
|
LOG_WARN("No tox_options._options_pointer to add self_logger_cb" )
|
||||||
|
|
||||||
retval = tox_wrapper.tox.Tox(tox_options)
|
retval = toxygen_wrapper.tox.Tox(tox_options)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if app and hasattr(app, '_log'):
|
if app and hasattr(app, '_log'):
|
||||||
pass
|
pass
|
||||||
LOG_ERROR(f"tox_wrapper.tox.Tox failed: {e}")
|
LOG_ERROR(f"toxygen_wrapper.tox.Tox failed: {e}")
|
||||||
LOG_WARN(traceback.format_exc())
|
LOG_WARN(traceback.format_exc())
|
||||||
raise
|
raise
|
||||||
|
|
||||||
if app and hasattr(app, '_log'):
|
if app and hasattr(app, '_log'):
|
||||||
app._log("DEBUG: tox_wrapper.tox.Tox succeeded")
|
app._log("DEBUG: toxygen_wrapper.tox.Tox succeeded")
|
||||||
return retval
|
return retval
|
||||||
|
|
|
@ -2,7 +2,7 @@ import os.path
|
||||||
import utils.util
|
import utils.util
|
||||||
import wave
|
import wave
|
||||||
|
|
||||||
import tox_wrapper.tests.support_testing as ts
|
import toxygen_wrapper.tests.support_testing as ts
|
||||||
with ts.ignoreStderr():
|
with ts.ignoreStderr():
|
||||||
import pyaudio
|
import pyaudio
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ class AudioFile:
|
||||||
self.stream.write(data)
|
self.stream.write(data)
|
||||||
data = self.wf.readframes(self.chunk)
|
data = self.wf.readframes(self.chunk)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.error(f"Error during AudioFile play {e!s}")
|
LOG.error(f"Error during AudioFile play {e}")
|
||||||
LOG.debug("Error during AudioFile play " \
|
LOG.debug("Error during AudioFile play " \
|
||||||
+' rate=' +str(self.wf.getframerate()) \
|
+' rate=' +str(self.wf.getframerate()) \
|
||||||
+ 'format=' +str(self.p.get_format_from_width(self.wf.getsampwidth())) \
|
+ 'format=' +str(self.p.get_format_from_width(self.wf.getsampwidth())) \
|
||||||
|
|
|
@ -854,14 +854,14 @@ id(42)
|
||||||
cmd = textwrap.dedent('''
|
cmd = textwrap.dedent('''
|
||||||
class MyList(list):
|
class MyList(list):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__() # tox_wrapper_call()
|
super().__init__() # toxygen_wrapper_call()
|
||||||
|
|
||||||
id("first break point")
|
id("first break point")
|
||||||
l = MyList()
|
l = MyList()
|
||||||
''')
|
''')
|
||||||
# Verify with "py-bt":
|
# Verify with "py-bt":
|
||||||
gdb_output = self.get_stack_trace(cmd,
|
gdb_output = self.get_stack_trace(cmd,
|
||||||
cmds_after_breakpoint=['break tox_wrapper_call', 'continue', 'py-bt'])
|
cmds_after_breakpoint=['break toxygen_wrapper_call', 'continue', 'py-bt'])
|
||||||
self.assertRegex(gdb_output,
|
self.assertRegex(gdb_output,
|
||||||
r"<method-wrapper u?'__init__' of MyList object at ")
|
r"<method-wrapper u?'__init__' of MyList object at ")
|
||||||
|
|
||||||
|
|
|
@ -67,10 +67,10 @@ except ImportError as e:
|
||||||
logging.log(logging.DEBUG, f"color_runner not available: {e}")
|
logging.log(logging.DEBUG, f"color_runner not available: {e}")
|
||||||
color_runner = None
|
color_runner = None
|
||||||
|
|
||||||
import tox_wrapper
|
import toxygen_wrapper
|
||||||
import tox_wrapper.toxcore_enums_and_consts as enums
|
import toxygen_wrapper.toxcore_enums_and_consts as enums
|
||||||
from tox_wrapper.tox import Tox
|
from toxygen_wrapper.tox import Tox
|
||||||
from tox_wrapper.toxcore_enums_and_consts import (TOX_ADDRESS_SIZE, TOX_CONNECTION,
|
from toxygen_wrapper.toxcore_enums_and_consts import (TOX_ADDRESS_SIZE, TOX_CONNECTION,
|
||||||
TOX_FILE_CONTROL,
|
TOX_FILE_CONTROL,
|
||||||
TOX_MESSAGE_TYPE,
|
TOX_MESSAGE_TYPE,
|
||||||
TOX_SECRET_KEY_SIZE,
|
TOX_SECRET_KEY_SIZE,
|
||||||
|
@ -79,7 +79,7 @@ from tox_wrapper.toxcore_enums_and_consts import (TOX_ADDRESS_SIZE, TOX_CONNECTI
|
||||||
try:
|
try:
|
||||||
import support_testing as ts
|
import support_testing as ts
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import tox_wrapper.tests.support_testing as ts
|
import toxygen_wrapper.tests.support_testing as ts
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from tests.toxygen_tests import test_sound_notification
|
from tests.toxygen_tests import test_sound_notification
|
||||||
|
@ -511,7 +511,7 @@ class ToxSuite(unittest.TestCase):
|
||||||
try:
|
try:
|
||||||
oRet = method(*args)
|
oRet = method(*args)
|
||||||
if oRet:
|
if oRet:
|
||||||
LOG.info(f"wait_ensure_exec oRet {oRet!r}")
|
LOG.info(f"wait_ensure_exec oRet {oRet}")
|
||||||
return True
|
return True
|
||||||
except ArgumentError as e:
|
except ArgumentError as e:
|
||||||
# ArgumentError('This client is currently NOT CONNECTED to the friend.')
|
# ArgumentError('This client is currently NOT CONNECTED to the friend.')
|
||||||
|
@ -1788,7 +1788,7 @@ def iMain(oArgs):
|
||||||
|
|
||||||
def oToxygenToxOptions(oArgs):
|
def oToxygenToxOptions(oArgs):
|
||||||
data = None
|
data = None
|
||||||
tox_options = tox_wrapper.tox.Tox.options_new()
|
tox_options = toxygen_wrapper.tox.Tox.options_new()
|
||||||
if oArgs.proxy_type:
|
if oArgs.proxy_type:
|
||||||
tox_options.contents.proxy_type = int(oArgs.proxy_type)
|
tox_options.contents.proxy_type = int(oArgs.proxy_type)
|
||||||
tox_options.contents.proxy_host = bytes(oArgs.proxy_host, 'UTF-8')
|
tox_options.contents.proxy_host = bytes(oArgs.proxy_host, 'UTF-8')
|
||||||
|
|
|
@ -5,7 +5,7 @@ import wave
|
||||||
|
|
||||||
from ui import widgets
|
from ui import widgets
|
||||||
import utils.util as util
|
import utils.util as util
|
||||||
import tox_wrapper.tests.support_testing as ts
|
import toxygen_wrapper.tests.support_testing as ts
|
||||||
with ts.ignoreStderr():
|
with ts.ignoreStderr():
|
||||||
import pyaudio
|
import pyaudio
|
||||||
|
|
||||||
|
@ -118,6 +118,7 @@ class IncomingCallWidget(widgets.CenteredWidget):
|
||||||
self.thread = None
|
self.thread = None
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
|
LOG.debug(f"stop from {self._friend_number}")
|
||||||
if self._processing:
|
if self._processing:
|
||||||
self.close()
|
self.close()
|
||||||
if self.thread is not None:
|
if self.thread is not None:
|
||||||
|
@ -128,8 +129,7 @@ class IncomingCallWidget(widgets.CenteredWidget):
|
||||||
if not self.thread.isRunning(): break
|
if not self.thread.isRunning(): break
|
||||||
i = i + 1
|
i = i + 1
|
||||||
else:
|
else:
|
||||||
LOG.warn(f"SoundPlay {self.thread.a} BLOCKED")
|
LOG.warn(f"stop {self.thread.a} BLOCKED")
|
||||||
# Fatal Python error: Segmentation fault
|
|
||||||
self.thread.a.stream.close()
|
self.thread.a.stream.close()
|
||||||
self.thread.a.p.terminate()
|
self.thread.a.p.terminate()
|
||||||
self.thread.a.close()
|
self.thread.a.close()
|
||||||
|
@ -153,7 +153,7 @@ class IncomingCallWidget(widgets.CenteredWidget):
|
||||||
# ts.trepan_handler()
|
# ts.trepan_handler()
|
||||||
|
|
||||||
if self._processing:
|
if self._processing:
|
||||||
LOG.warn(__name__+f" accept_call_with_video from {self._friend_number}")
|
LOG.warn(f" accept_call_with_video from {self._friend_number}")
|
||||||
return
|
return
|
||||||
self.setWindowTitle('Answering video call')
|
self.setWindowTitle('Answering video call')
|
||||||
self._processing = True
|
self._processing = True
|
||||||
|
@ -164,11 +164,14 @@ class IncomingCallWidget(widgets.CenteredWidget):
|
||||||
self.stop()
|
self.stop()
|
||||||
|
|
||||||
def decline_call(self):
|
def decline_call(self):
|
||||||
|
LOG.debug(f"decline_call from {self._friend_number}")
|
||||||
if self._processing:
|
if self._processing:
|
||||||
return
|
return
|
||||||
self._processing = True
|
self._processing = True
|
||||||
try:
|
try:
|
||||||
self._calls_manager.stop_call(self._friend_number, False)
|
self._calls_manager.stop_call(self._friend_number, False)
|
||||||
|
except Exception as e:
|
||||||
|
LOG.warn(f"decline_call from {self._friend_number} {e}")
|
||||||
finally:
|
finally:
|
||||||
self.stop()
|
self.stop()
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from tox_wrapper.toxcore_enums_and_consts import *
|
from toxygen_wrapper.toxcore_enums_and_consts import *
|
||||||
from qtpy import QtCore, QtGui, QtWidgets
|
from qtpy import QtCore, QtGui, QtWidgets
|
||||||
from utils.util import *
|
from utils.util import *
|
||||||
from ui.widgets import DataLabel
|
from ui.widgets import DataLabel
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from ui.widgets import *
|
from ui.widgets import *
|
||||||
from tox_wrapper.toxcore_enums_and_consts import *
|
from toxygen_wrapper.toxcore_enums_and_consts import *
|
||||||
|
|
||||||
|
|
||||||
class PeerItem(QtWidgets.QWidget):
|
class PeerItem(QtWidgets.QWidget):
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from qtpy import uic
|
from qtpy import uic
|
||||||
import utils.util as util
|
import utils.util as util
|
||||||
from ui.widgets import *
|
from ui.widgets import *
|
||||||
from tox_wrapper.toxcore_enums_and_consts import *
|
from toxygen_wrapper.toxcore_enums_and_consts import *
|
||||||
|
|
||||||
|
|
||||||
class BaseGroupScreen(CenteredWidget):
|
class BaseGroupScreen(CenteredWidget):
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# -*- mode: python; indent-tabs-mode: nil; py-indent-offset: 4; coding: utf-8 -*-
|
# -*- mode: python; indent-tabs-mode: nil; py-indent-offset: 4; coding: utf-8 -*-
|
||||||
from qtpy import QtCore, QtGui, QtWidgets, uic
|
from qtpy import QtCore, QtGui, QtWidgets, uic
|
||||||
|
|
||||||
import tox_wrapper.tests.support_testing as ts
|
import toxygen_wrapper.tests.support_testing as ts
|
||||||
with ts.ignoreStderr(): # not out
|
with ts.ignoreStderr(): # not out
|
||||||
import pyaudio
|
import pyaudio
|
||||||
|
|
||||||
|
@ -504,7 +504,7 @@ class AudioSettings(CenteredWidget):
|
||||||
|
|
||||||
def closeEvent(self, event):
|
def closeEvent(self, event):
|
||||||
if 'audio' not in self._settings:
|
if 'audio' not in self._settings:
|
||||||
ex = f"self._settings=id(self._settings) {self._settings!r}"
|
ex = f"self._settings=id(self._settings) {self._settings}"
|
||||||
LOG.warn('AudioSettings.closeEvent settings error: ' + str(ex))
|
LOG.warn('AudioSettings.closeEvent settings error: ' + str(ex))
|
||||||
else:
|
else:
|
||||||
self._settings['audio']['input'] = \
|
self._settings['audio']['input'] = \
|
||||||
|
@ -574,7 +574,7 @@ class VideoSettings(CenteredWidget):
|
||||||
if index in self._devices:
|
if index in self._devices:
|
||||||
self._settings['video']['device'] = self._devices[index]
|
self._settings['video']['device'] = self._devices[index]
|
||||||
else:
|
else:
|
||||||
LOG.warn(f"{index} not in deviceComboBox self._devices {self._devices!r}")
|
LOG.warn(f"{index} not in deviceComboBox self._devices {self._devices}")
|
||||||
text = self.resolutionComboBox.currentText()
|
text = self.resolutionComboBox.currentText()
|
||||||
if len(text.split(' ')[0]) > 1:
|
if len(text.split(' ')[0]) > 1:
|
||||||
self._settings['video']['width'] = int(text.split(' ')[0])
|
self._settings['video']['width'] = int(text.split(' ')[0])
|
||||||
|
@ -621,7 +621,7 @@ class VideoSettings(CenteredWidget):
|
||||||
self.deviceComboBox.addItem(util_ui.tr('Device #') + str(i))
|
self.deviceComboBox.addItem(util_ui.tr('Device #') + str(i))
|
||||||
|
|
||||||
if 'device' not in self._settings['video']:
|
if 'device' not in self._settings['video']:
|
||||||
LOG.warn(f"'device' not in self._settings['video']: {self._settings!r}")
|
LOG.warn(f"'device' not in self._settings['video']: {self._settings}")
|
||||||
self._settings['video']['device'] = self._devices[-1]
|
self._settings['video']['device'] = self._devices[-1]
|
||||||
iIndex = self._settings['video']['device']
|
iIndex = self._settings['video']['device']
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from tox_wrapper.toxcore_enums_and_consts import *
|
from toxygen_wrapper.toxcore_enums_and_consts import *
|
||||||
import ui.widgets as widgets
|
import ui.widgets as widgets
|
||||||
import utils.util as util
|
import utils.util as util
|
||||||
import ui.menu as menu
|
import ui.menu as menu
|
||||||
|
|
|
@ -3,7 +3,7 @@ from qtpy import uic
|
||||||
import utils.util as util
|
import utils.util as util
|
||||||
import utils.ui as util_ui
|
import utils.ui as util_ui
|
||||||
from ui.contact_items import *
|
from ui.contact_items import *
|
||||||
import tox_wrapper.toxcore_enums_and_consts as consts
|
import toxygen_wrapper.toxcore_enums_and_consts as consts
|
||||||
|
|
||||||
|
|
||||||
class PeerScreen(CenteredWidget):
|
class PeerScreen(CenteredWidget):
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
../../toxygen_wrapper.git/wrapper_tests/
|
|
Loading…
Reference in a new issue