Skip to content

Commit

Permalink
[feat] Support for camilladsp 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bitkeeper committed Jan 24, 2025
1 parent 2b1b636 commit bb5e81b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2.0.0
* [fix] Support for Camilladsp 3.x
* [refactor] drop support for older versions

1.0.0
* [refactor!] Drop support Camilladsp 1.x
* [fix] Correct initial statefile generation
Expand Down
8 changes: 4 additions & 4 deletions mpd2cdspvolume.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

import camilladsp

VERSION = "1.0.0"
VERSION = "2.0.0"

def lin_vol_curve(perc: int, dynamic_range: float= 60.0) -> float:
'''
Expand Down Expand Up @@ -183,15 +183,15 @@ def update_cdsp_volume(self, volume_db: float):
if self._cdsp.is_connected() is False:
self._cdsp.connect()

self._cdsp.volume.set_main(volume_db)
self._cdsp.volume.set_main_volume(volume_db)
time.sleep(0.2)
cdsp_actual_volume = self._cdsp.volume.main()
cdsp_actual_volume = self._cdsp.volume.main_volume()
logging.info('volume set to %.2f [readback = %.2f] dB', volume_db, cdsp_actual_volume)

# correct issue when volume is not the required one (issue with cdsp 2.0)
if abs(cdsp_actual_volume-volume_db) > .2:
# logging.info('volume incorrect !')
self._cdsp.volume.set_main(volume_db)
self._cdsp.volume.set_main_volume(volume_db)
return True
except (ConnectionRefusedError, IOError) as e:
logging.info('no cdsp')
Expand Down

0 comments on commit bb5e81b

Please sign in to comment.