Commit 2eadfd72 authored by llea's avatar llea

Add ring for incoming call

parent 9e879e3d
This diff is collapsed.
......@@ -14,6 +14,7 @@ BIN_DIR = $(PREFIX)/bin
SHARE_DIR = $(PREFIX)/share
PIXMAPS = pixmaps
SKINS = skins
RINGS = rings
METAL_SKINS = metal
INC_OTHERS = ../stund
......@@ -106,6 +107,8 @@ install: all
chmod -R a+rX $(SHARE_DIR)/$(PROGNAME)/$(PIXMAPS)
cd ..; cp -R $(SKINS) $(SHARE_DIR)/$(PROGNAME)/ ; \
chmod -R a+rX $(SHARE_DIR)/$(PROGNAME)/$(SKINS)
cd ..; cp -R $(RINGS) $(SHARE_DIR)/$(PROGNAME)/ ; \
chmod -R a+rX $(SHARE_DIR)/$(PROGNAME)/$(RINGS)
uninstall:
rm -f $(BIN_DIR)/$(PROGNAME)
......
......@@ -54,7 +54,7 @@ AudioBuffer::setData (short *buf, int vol) {
short *databuf = data;
for (int i = 0; i < (int)size; i++) {
databuf[i] = buf[i]*vol;
databuf[i] = buf[i]*vol/100;
}
}
......@@ -245,9 +245,6 @@ AudioRtpRTX::run (void) {
// Send session
////////////////////////////
if (!manager->mute) {
// i = audioDevice->readBuffer (320);
// data_from_mic = (short*)manager->audiodriver->audio_buf.getData();
// qDebug("audiortp data_from_mic 0x%d", data_from_mic);
i = audioDevice->readBuffer (data_from_mic, 320);
} else {
// When IP-phone user click on mute button, we read buffer of a
......@@ -256,7 +253,7 @@ AudioRtpRTX::run (void) {
}
for (int j = 0; j < i; j++)
data_from_mic_tmp[j] = data_from_mic[j]*manager->getMicVolume()/10;
data_from_mic_tmp[j] = data_from_mic[j]*manager->getMicVolume()/100;
// Encode acquired audio sample
compSize = AudioCodec::codecEncode (
......@@ -294,9 +291,9 @@ AudioRtpRTX::run (void) {
adu->getSize());
// Write decoded data to sound device
manager->audiodriver->audio_buf.resize(expandedSize);
manager->audiodriver->audio_buf.setData (data_for_speakers,
manager->getSpkrVolume()/10);
audioDevice->audio_buf.resize(expandedSize);
audioDevice->audio_buf.setData (data_for_speakers,
manager->getSpkrVolume());
// i = audioDevice->writeBuffer (data_for_speakers, expandedSize);
i = audioDevice->writeBuffer ();
delete adu;
......
......@@ -148,7 +148,7 @@
</widget>
<widget class="QLayoutWidget" row="0" column="1">
<property name="name">
<cstring>layout17</cstring>
<cstring>layout19</cstring>
</property>
<vbox>
<property name="name">
......@@ -792,6 +792,27 @@
</grid>
</widget>
</widget>
<widget class="QWidget">
<property name="name">
<cstring>RingPage</cstring>
</property>
<attribute name="title">
<string>Rings</string>
</attribute>
<widget class="QComboBox">
<property name="name">
<cstring>ringsChoice</cstring>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>21</y>
<width>150</width>
<height>20</height>
</rect>
</property>
</widget>
</widget>
</widget>
<widget class="QTabWidget">
<property name="name">
......@@ -1115,7 +1136,7 @@ Montreal, Quebec H2T 1S6&lt;/p&gt;</string>
</widget>
<images>
<image name="image0">
<data format="PNG" length="3693">89504e470d0a1a0a0000000d49484452000000ad0000003008060000006357fade00000e3449444154789ced5d4d6c1bc719fd08f8a0044640073d584150484113802a1084aa72a0da045e219750729050c9c1529b0365b9b0945e22bb17ff040ee3832333855b298552d18051310104d907995601a3a203065400b9a40a15940b06900ab5580542410bac410b8281d7c372a9dde5cceecc924ee4987379367767e69bd96fdebef976664420a24922aa1b02c03a0000e9326207a87b3d0d7c6cb166074de455144a807f621e741ea073335c54e2c0c8cd1c00e0fb6e78031f5d749531b709ac16016f34014a01747e461abd8b4078160d076ea034ca6500a05c7166545954e2805a2c352444038550e846ec00851d778c2a839154aee1b80d7444c71b729b25f863f565563bf44fcc372443036dd1f6066c02dec587cfb056f446130dc76d2017b917729b2578a32e18733c018a0134310f8a01c16b1900c0cc8a8ad28e7839de0b33b53b2e80b18949848f0f213c3854c630c2c787301a1d058a80aaaa8f8e24019098adef802e154b188d02e1c121040e29080f8681a2cbf21f827d2cac0fc35ed00c4511b629bd8aef8471510290047c1d7ecc7424e0ebf0c3df11e0feffd4b9c823c1eca7ce452af6d7cb5e35ae56f5c7c8c9115703f961d827c4b4a51d4833ac480acf655c695c378c1b3e3e647a10c19e10c62626010053f119200a283dc1ca757f4700996c66ef33ae6e7fbd1c0230f593bf2380f0e090fbf2eb6d1f07ab7e50d62535e8b2b3c306a6d335695ce54a5adca16066d8c26c89db81c8035081c45cc2b67ce451fb8370ca5f43f9505dd807207048a97a0321cb2f0779b81ad8b2f639ddef9924a201228a11d10000cf875789f6f5123d10c3b03f4bb1d7db899706fe92a5cb4bedc2e5f170eaf006f5bff88c2766b49781d96c06478fbd47dbb44d4dd44401a593c647a38ef94c08a0b7af9fd6be59ab9463c4a012a4e1c1016a7de1394fe72105dbf7b6a9697f132ddc4a52cce3f118cb4ba6d2387df6346ddddb22bfcf475d7ffedca3dbd9fa858fba6f77d3f6bd6d53f97e9f8ffc2ff9e9c4fb27cce54581b62fdaa9899ae8e22717a9ebd59f7bc6272611fb53ac92df7bf0006d7d7b97b6699b5666b3147bc66c8f8ebaddacf6ad24b3147bcae31928025d7ddd95f28cf735ed6fa20525491b831bd4fc4cf9b908d8d7b4bfa9d2de8a7d00c63f8bd1dcf5395afb76cd548ff7e0014abe7583eebf739f9e78ea494f8c2c23cfcd172eb5c46758590debf4054d680d83e59537d39140b027046481742a2d34e2f5fc81438aa6d3cb4c3b7272a4c24881d714a004ccbf96aed417ec0956d9977e3353757d343a5665df6a5c45f8f890a93c5f87df34293231625efb9da549f5ff9f3a17e1f797cad6fc85d91250d2fad9d47f456812aadc0ffafde93733b5d96761fcf49b19edf72c103ad267eeef32d3579876603683cbff70c1883f4a128e75315976f87f449ffeae36863562e46c2f357bd8cc61c222d0d6d55ec52056a6f0f97cd4f58b2eeaefeb35331a80ec5296dadb7f56c5d06d1d7e5418e97696c63f8b9191496ecc5edd651e006d2fb79b18ecc69737e8cc87e7699bb6c9bbdf4bc383c3d4dfffb6b91e15687bc390ef7696621e8f67bc2300bd9e81c1011afef551cfc0e010969696aa98baef9d3eea7ea3c7138fcf20f8f7209dd87a8f685f13b5bfd44ec3c706b4f65aea091d0e51eb07679cfbc1da2eb7f61deea68163c3a45f0f2a41f28d9e373ddfd3e72298bb3e47dbb44d819703d4f9c74f3d9a86d8a92d1e9bdbe450ed66fd98563a9a0060343a86dcc4aa50144167065679996c065081604fc8941f595498c2ca30206d366d65249d79673a12989a9ee1336172f78da1cfe659f6ae96998c55ff2411b1daabd78b2caadb63d3afc8a2dc0f415379fa2456d63ee4cdf5878ef401d86574a450f5fc0040635a175ad68881c15e5a6866922d5dfc7a8d4ede6aad0bd36ada768dfa5f7c4e4ea312d186aaa2b9b999925f2d50d7379dd4fbd76acdaa33c64011188e9ca0a5db59dabab7c5656cfdfebb51e07259cbe9da76ed9b35ea3f3650c91f397b8abadfe8f15899daaa818d5af8c4fb272a8c3cf0e52d0e9385b1b474a762d7f0dfbeae62aa8d6f37881e10d13ea2a6fd4fd0f8c717b57a398c697c63c9f483b47d96fa9dd0bbdf4bf3b337348ff74fd4ce88766974a17e8c3b63c388b298984b98186372621246860b1c520055631700989a9e61320c547019bca209cbf5b2f233ed2ba22abf886694697f269b61b6c7ca90baa635f6038ba165edb3d62f1a2ff7a8c5129ef9c3133533e0cc5b1bd4ebe3d02d115dbdb3416f5f6f26daae9d7171b697cb50262de66f77bccf38d2c347b264654c6bfeae9e202ab373033319b55715131dcf526c40bbcfa8f1581a4ec7de237dd0df042b87b314fb404c335a99d6294ac2645ac3efcc7ea841d3da31addd9b674355a1cf1508a803038ecfdb326d251501b5547b7d53cb36da0bd571daa9e9f29ba01ce948a7d22646d5352752361a0fe65933eb3a4b33eb51063bfb4cf14f3066cdea2e93396a4609a6e5695ae31b28f09a627e2358ec93d6b4563bb2bbfda1476b2af69500e477e70c95e841d86dd44047ef0dc25037976179c9f35992e8bf5daeea1d39d94bbe27d923f27eb184a3c34769e9ce1d61ade4f7f9e8a3331f51ebf3ad648dcf7a0f1ea0ed7bf7999aae8a19ce016dd7cd1a4d671c2bc3751d66c73f8dd87ab095c63eb948ad2f681a3e7648816e074b33b61e6ca550e25a5d98b653e932c58f45fae15a4f087a9c95659faecdad7618e704bcfe687dbe95ae7e1ea798c7e3a179d92f60060c9517c3b84da79239975fc86c98d6c008a3d151f0e284b989554d4359178740d36c7adc548dabdaec5d2dcf6af3d0b4af0a3383eacc9004c2c787b01a57b54539367626e612a6fbf5fa46a36300aab55d622eb16b8f7e1dbbf9d329892f8786f6eaed61fdae96ed5a8dab5a7fa9d018395f9dcfc93edb2f8f8cfac2c78780248094b99fc9d5bad74bdaaaad7aa4f46a01342e57bf37baf717b734f0e121c9325da600c7d55cd2a9082454c968854dc3b0a3153b721350d6773753367605ff30509c692f88ade6aa25c9acb7b56b580b87b9fdb1da19ba541e10e9f502004e7986ebe9f5425d074a8933f0f4fa22a91c22d07649d7a3beb1c555848be5454b00729be6f624f22a94b8765dc37944e07ecf5f6eb38008cce58536cde58931edf843f75753aa9569dde613c1997c757cdaeab0ac7a0b3bb5af12d3d786f827cc8e8b2298ed4dafb31d5cdc61abcbf52e9adb91d9e43fa7919b127bfe00846c56031afbd99969bf038665a55a98d66d3ea15793a53ceb66ccd0749a6bb712d7de266e198fdb0e4e7f45505b7b239c728d0e54da019438bfbf85f6fc0168b994e0f65ba164ceefc8b40f23e536350d9b587170dc3dc8b4760c3049ceeb91fdf9f25a0dd9fac16f477a9dcdb491948b7a0c1849493038f8ab046dd78cd8e46b1967e7233b0f0fd42740c07648c39eb2510005c6e42e5470a74dbf4fa6153917c21b95d7ba91544e9a69b98e22335064ca85fd49432de3bb9a7be4660ebcb9079db73f89881fa75d04374a10ba06505e930e9402e88a0ba75d66d45b16fb955404285b7d5f681a7b966965e2deb65ff6580ec46907b84c5bdb391291143b8e0e07adcc636811f42e3a975f3582750c5a3e1c8c2473a04bec91a1cfa8a59c9637222d1a3a74ad7a6f99d551f616d3f2352d0bc3b3627bd3dc30ed77a16979985e2f48ef35f4c7c4343f77b66b72b0f179db11e2a44d994e9be7975755bfe4ac782f695a7f1e4818f798417374e3fae5d0b4c08e0af0dbb127342d03657675b72c43388ece65a65d87e56b5ee3c893765a815316036af57dde0bce8eb797342d8f394a3b406873f73ea759f6c8cd4740d30ae66761cb25f105fe04220a4d578f28b50490c89e3181ddb84ca775605a1eae0a1c24b15734adc82e62eb1969851d687309c38367c54b4d8cb6c734ad6eb7ec9e43d123b16adfb9f0ec02e1dd4e924d6e5779a57f75973a7ffcb4edce85a3e7015e7ef537f7a9b9bcab5366e7838e9e73333096177965854ebffad34a795d57d2b8f59f4ea2075749f9492ff5f70bec690370e0e3abb4f540bc1f264f99d7b7b29e9ff09e3a0ede2901d151b9f5ccf77780ed07444f33f289a077df55bafb5bfbf5d2150f6e61cde605d06e376ebd9956687517913dd30abe82eaa16945ed75c34cc6fc39ce5e3ca9fa19d832ceb687ab61d7013b3ff24f68cf3e92caa1b0a3c56179ed9b5fb7bc718ccf57ffc7d4b22aa43d9ca20cc24e2b598f8c96722a275c74583b6037202434ad12973f4043e444759636e7c5dbdd4a84f02cfb442066b4035a5cd52e2ac08b4b8f2dae72a30cde2830b6b85a958fcc1deee22498bc0b8f75711e82b22eee006ede1876233e61d859506f4dcb7618e7fe91616a458fa33bcccef5d5713c06646a4e9bfb758deed45e1401bfcd9b57b7dfac69c9fd0933bac69149b2e72178f7f7d2caa0b816b5d3b46e51d7904e9ad6787e84b0a665607c7915bfbccedfc56cd2b486e7d7fafb1bf4af7bdddc7ccab30b74e0f54ef2ff7385e89536a2af5628f9ef36daba97a4259b3986f26c9292ef7655b4e6fd1de0cc032296e615d5a6565c280297397e612c8f1da69064a453c99c14d10a45250c28f5e588cae1a13a31ad75166ed4ac4c8d6ce8bf919b7276b334228b81fc13f3b6e54e2d03d6d5686e31b3c98ecbdaadeed29731ba6ab7cd1b43ef6f66c6705152735ed076208824d9d31345bf1859d1baeed52df23ad6e97a5dff8684d52e897c53cbaba6f5a93cedeb9f988712d73e7454d6e3da38ded4b2b68ed67b41cbaf5c4923b459a775bcd0b4ac12dffd1b1f2d971295bfcdc1d536761a8389cbdad95d7649f6fc03b79ab0813f6cb4652a377f6b81b7d9d11f97fb262ff469b3818f253adeb05aac9f361445b792a0818f078add885dede226be2a8adea8a6c1f642c73470efa27886b2987f580cabd87c016960038d289d21bd5eb0dd13248b3585471af858a2fb02a0c521ddac5968194f54af666a600305b13e0501985ad6e27aa1e974d53ef8d06639405feff865031f4bfc3fdcfb64f7cd732d720000000049454e44ae426082</data>
<data format="PNG" length="3603">89504e470d0a1a0a0000000d49484452000000ad0000003008060000006357fade00000dda49444154789ced5d5f685bd71dfe095270465694b187b8946197b5e00c4ae5b90ff2d6926bfa32c529addc3e24defa20c519b1b787d5695f9ca4b86a1e5247856c76873b2b1066b5609c3c388a076156868b5c706a7964480117e4e10db998e118116e8c097c7bb8bad2fd73cebde75c29a9d3e8bc7c89eef9f33be7fece77bff3bbe75c1388688288ea8600b0060040a68cd801eade4e039f58acd941532b450040607c0e740ea0e1692e2a4960f0460e00f05d77bc818f2f7a2a98db005400fe780a9405e8dcb434faf34064060d076ea034ca1500a05c76675459549240b1a43624440385502823763446f4c2a832189bcf351cb781aee89a21b7a12290a82fb33a61607cae21191ae8888e19b001f8f30f9f61ade88fa71a8edb402e722fe43654f8e31e18732c054a00343e074a00a1ab4b0080e9bc166510adc77f7eba76c705303a3e81c8c97e44fafacb1841e4643f46e223008062b1f8f8481200a999fa4e68b5a462240e44fafa113ca420d217f15eff43b08f85f561d8f39aa128c131650a78248c0b15c022d0d61140a663096d1d01043a82dcff0f0dc71e0b661f1a8e55ecaf9bbd33b08dc7e07b839e26f243b18f81f699b7036986154991d9254f1ad70be3464ef69b6e44a83b8cd1f10900c064721a88034a77a8723dd011c4527669f733ae6e7fbd1c0266870d740411e9ebaf8969eb6a1f076d3f289b921ab4e0eeb0c1a94c4d1a57b99c11772898191669fe006205400948cda61cebc70a6abf116ee56ba81f450ff601081e526c4f20acb88cd723b0cf2dbf6f8288a2449420a22800df875788f6f4103d10c348204b895fb5132f45ff96a54bcbedc2f5f170f2c83af5bef88c2f61b49781d9ec128e9ff81d6dd33635511305954e1a1b89bb963321809e63bdb4facd6aa51e238694100df445a9f585e77c9d87146cdfdba6a67d4db470334d099fcf67ac2f3d9fc1e9b3a769ebde1605dadaa8ebaf9ffb743bdbbf68a7ce5b5db47d6fdb547fa0ad8d022f05e8d4bba7ccf5c581835fb4531335d1854f2e50d7abbff08d8d4f20f19744a5bcffc07edafaf62e6dd336e5d3594a3c6db64747dd6e56fff2b7b25abb00ba8e1caed467ccd7b4af89169434adf7ad53f333e5fb22605fd3bea64a7f2bf60118fb2c41b3d76669f5db55533bfe03fb29fde675bafff67ddafbf40f7c09b2cc3c2f6fb89c92ac86757b8326b48701768d16ea0e032b40663e2334e3f5f2c1438ad69132d30ebe375861a4e06b0aa002b9d70a95f642dd219b7d85378ab6eb23f1519b7dea0c1039d96faacfaa0d4d8c582cffced0a4faff878663fcf12ab1353fd2d05e771ada0b758701409350e571d0f317de28d6669f85f10b6f14b5df5780f0d163e6f12e337d8569a3334bb8f42f0f8cf8e334e1441793650788e85349e676c2d8d91e6af6b199c3ca94075f6eb731889529dadadaa8eb975dd47bacc7cc6800b2cb596a6fffb98da10f76046064a4b1cf12646492eb3357aacc63b1237f2b4bd7af5da7331f9ea36dda26ff3e3f0df40d506fef5be6764ac0c1ae761bf38d7504a1b713ed8bd2c06f8ffba27dfd585e5eb631f5b1b78fd1e1d7bb7dc9e4347affd943d1ad28d19e266a7fa99d064e44b5fe5ada091f0953eb0767dcc781d12f4ff61d394cd11303a45f0f29216a1b3967babfa7876398bd364bdbb44dc19783d4f9e74f7d9a86d8a92d1e9bdbe050ed46fd98563a9a0060243e8acda42a1445a83003a3bea5ec12500242dd6153796451610a1bc390b69ab63292cebc998e254c4e4df39970b1ca50fa6a9e65af3a63d1f0967eb0faabb78b2cecfd71185764511e8790a93e7d112b6b1f56cced878f1e33313ae661bb7f00a031ad072d6bc4e01f7a68e1874cb2a50b5fadd27b375bebc2b49ab65da5de179f93d3a844b45e2ca2b9b999d25f2e50d7379dd4f377bb66356ab981f74fd1f2ad2c6ddddbe232b69eff6e1cb854d672bab65dfd66957a4f442be5636787e8f0ebdd3e2b535b35b0510b9f7af7548591a3ffb8c961b2089697ef54ec1af8fa2b1b53ad7fbb4ef48088f61035eddb4b631f5fa8f493c598464695190769fb049e8846f4eff3d3dccc75cde303e3b533a2531a59a81fe3661c18511653b32913634c8c4fc0c870c1438a167b2eaf6627a7a6990c8322b80c5ed184e57659e5dda2207a7911cd28d3ffa5ec12b33f5686d435ad711c580c2d6b9fb57dd178b9af5852f1cc9ff6d6cc80d36fae534f5b339b6e89e8ca9d757aeb5a33d176ed8c8bb33d5c863269b140bb6b3ee34c8f1ccd929531ade5bbba43a8acce0dcc64d45e36263a99a54454cb67d4782c0da763cfd163d09f04f923594a7c20a619ad4c2ba3fd8d4f1afd77e638d4a0699d98d6e9c9b35e2c425f2b105007061c9b7364da4a2abf31abb5bdc9db0eda0bf638ede454f949a06a9099cf981855d79c9877d07830af9a59d7599a598f3238d9678a7f82b16a2e5699cc55334a302d4fd31a9f40c1d714f313c1629fb4a6b5dab152bdae476b2af6a91abbeb6b864af420e2356aa0a3ff3aa1ff30976179c9f7599ae87f5d9eda1d3cdb436d9c1979bfa4e2f8c0715abe7347582b05dadae8a3331f51ebf3ad648dcffa0feca7ed7bf7999acec60cc3c0c16b668da6338e95e178f14f23b61e68a5d14f2e50eb0b9a864f1c52a0dbc1d28cad075a299cba5a17a6ed54ccf1639171b8da1d861e6765d9a76b73ab1dc635016f3c5a9f6fa52b9f2729e1f3f92827fb06cc80e1f26618af69289df3f886cc81690d8c30121f012f4eb89954d91a0a1a33eb7153cc680c8b5279555b84a67d4b3033a8ce0c8b5a3975a6dcbe839da9d99429bfdede487cd46e979e5fb747bf8e6af9ccbcc49b43437ff5fe307f9fa9d63f341cd3fa9d85691c44ed737cf3c8682f72b21f5804306f1e67f2b4eff56275d756ad2953d8048dc9b5ef8feffecd2d0d7c7848b24c57dc81eb6e2ee95402964a92d10a878ee9272d066f00ca66f53065e354f0f703c599f6bcd86eae5a93a83d4e1d6be1307720513b43abe5099159db04c0a9cf703db3b659d789a272269ede5e6c3e8718caa7a4ebd0dee862011194372d01c86d98fb935a2942496ad7359c430cdecffce536361183b9beb06aae4f8c69c71e89bf5652ad4cebb59c08668af6f8b4d5617971ec9a1c08d5bd21817198b57409ccfe66d650537f4717edf5faf3e67e1455fe7d1abc2171e60f40d86137a071fcdc99f61131ac35d5c2b45ecb093d9a2cf5590f6386a7325cbb9524c0634a11c6e3f683335eb11a274a8c53afd181d41d4049f2c75be8cc1f80968b29eeb859cbbb32edc348b90d4dc3a6f22e8ebb0b99d68d411597684ca058deab21db3ef8fdc8acb1993636efa11d03c6e625181cfc5d828e7b461ccab58cb1cb91938707ebbde0323aa4e14cd908804d465be11d6fdaf4bb645a91ef42f8e3f25a37369f93665aaea3c84c14997ae1fca5a196b1aae61ebc91036fed41e79cbf44c48fd3e6c18d1284af0254d4a4036501baecc1690b8c76cb62bf924a00add8f385a7b06b995626eeedf8668fe5409c7e80cbb4b57d472236cf8ea3c3452bf3185a04fd79f7fa6d3358c790e5c5c1603a07bac89f79d24ecb9b91160d1dbe6a3f5b667594ddc5b47c4dcbc2c88cd8d9342f4cfb28342d0f336b9bd2670d030931cdefb8daad38d8d89ce30c71d3a64ca72df2ebb3b52fb92ade4d9a36500452c63366d01cddb87f393c2570a202fc7eec0a4dcb409953dd2d0508c7d1b9cc547558bee67d284c6bd1d4d67cfef3ee8eb79b342d8f39d41d20ac56f3b9adb2076f3c069a56b03c0b5b2e8a6ff027105178ca3ea3008044ce8c099cc6653aad0bd3f25015e8d86ed1b442a788c178c2940c8e0e80152f3531da2ed3b4baddb2670e453f8955fbc985671708ef74926cf2bacb2bf39bbbd4f9931f399e5c387e0ee0952ffefe3e35974f75ca9c7cd0d1373c0d637db157f274fad59f55eaebba9cc1cdff76123db842ca4f7ba8b757ec4cdbfe8fafd0d603f171981832ef6f65dd3fe133751cbc0320cea8d7693ff3fd1d60ef53445efdc9bfe70add7ddf79bf74c5835b58ab7901f49abc30add0ee2e2267a61598c9f5d2b4a2f67a612663f91ce72c9e54fb0c6c1963dbc3d5b06b80931f05c6b57b1f9bd7c259bcfae9dc34729b96278ef1feeaff98bc5d14d21e6e510661a7956c47464bb9d51381cbde01a70921a16995a4fc073444bea8ced2e6bc78bb57891099617f118819ed801657758a0af0e2d2a38b056e94c11f0746170bb672641e700f5f82f1b243d1c3f710944d7107f0f2c4709af129c3c982ba6b5aa6c3b88f8f0c532b7a1cdd6575aeef8ee3312053733ae4177db2a104041c9ebcbafd664d4bdebf30a36b1c9924fb3d04ffbe1ecaf7896b51274deb15750de9a6698ddf8f10d6b40c4cde2ee0d7d7f8a7984d9ad670ff5aff789dfe7def30b79cf2ec02ed7fbb93025fe7895e3948f4659ed2ff39485bf7d2b4ecb0c6509e4d53fa9dae8ad6bcbf039c798a88a57945b5a91517005c12a8cf75352b8243e99c14d10a45250c28f5e688cae1a13a31ad75156ed4ac4c26318cdfe00d39bb591a91c54081f139c77a276f03d6dd685eb1a8b2e3b24ebbbbf46d8c9efaedf0c4d0c79b59300249cd795e3b81209264bf9e28fac6c88ad67daf5e9137b06ed7ebfa3724ac7649949bbc5d30ed4fe569dfc0f81c94a4f6a2a3b21fd7c1f1266f6bfb68fde7b5f2cae50cc26a9df6f142d3b24ab2fa373e5a2ea62a7f9b83ab6d9c3406130bdab7bb9c92ecf70fbc6ac2067ebfd191a9bcfcad05de61c74052ee9dbcd0abcd063e91e89a4145fdb4a1287a95040d7c32502c23aadac54b7c5514fd714d83ed868169e0ee45f1026531ffb01856d904f70d48031b6844e90299b54dc73341b2585378a4814f247aaf005a1cd2cb9e05fdec4f83591be805eb531180c9db5a5c2f3c95b19d830fabd54d128dbf81dbc05af1ff246a91a21391b6b20000000049454e44ae426082</data>
</image>
</images>
<connections>
......
......@@ -39,7 +39,21 @@ void ConfigurationPanel::init()
}
}
// List ring choice from "rings" directory
QDir ringdir(Skin::getPath(QString(RINGDIR)));
if ( !ringdir.exists() ) {
printf ("Cannot find rings directory\n");
}
ringdir.setFilter( QDir::Files | QDir::NoSymLinks);
ringdir.setSorting( QDir::Name );
QStringList ringlist;
ringlist = ringdir.entryList();
for (unsigned int i = 0; i < ringdir.count(); i++) {
if (ringlist[i] != "." && ringlist[i] != ".." && ringlist[i] != "CVS") {
ringsChoice->insertItem(ringlist[i]);
}
}
// For signalisations tab
fullName->setText(QString(Config::getchar("Signalisations", "SIP.fullName", "")));
userPart->setText(QString(Config::getchar("Signalisations", "SIP.userPart", "")));
......@@ -61,6 +75,8 @@ void ConfigurationPanel::init()
codec3->setCurrentText(QString(Config::getchar("Audio", "Codecs.codec3", "G711u")));
codec4->setCurrentText(QString(Config::getchar("Audio", "Codecs.codec4", "G711u")));
codec5->setCurrentText(QString(Config::getchar("Audio", "Codecs.codec5", "G711u")));
ringsChoice->setCurrentText(QString(Config::getchar(
"Audio", "Rings.ringChoice", "konga.ul")));
// For preferences tab
SkinChoice->setCurrentText(QString(Config::getchar(
......@@ -125,6 +141,7 @@ void ConfigurationPanel::saveSlot()
Config::set("Audio", "Codecs.codec3", codec3->currentText());
Config::set("Audio", "Codecs.codec4", codec4->currentText());
Config::set("Audio", "Codecs.codec5", codec5->currentText());
Config::set("Audio", "Rings.ringChoice", ringsChoice->currentText());
Config::set("Preferences", "Themes.skinChoice", SkinChoice->currentText());
Config::set("Preferences", "Options.zoneToneChoice",
......
This diff is collapsed.
/****************************************************************************
** Form interface generated from reading ui file 'configurationpanel.ui'
**
** Created: Fri Jan 28 18:58:55 2005
** Created: Mon Jan 31 18:13:29 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......@@ -94,6 +94,8 @@ public:
QLabel* textLabel1_4_3;
QLabel* textLabel1_4_4;
QLabel* textLabel1_4_5;
QWidget* RingPage;
QComboBox* ringsChoice;
QTabWidget* Tab_Video;
QWidget* DriversPage_2;
QWidget* CodecsPage_2;
......@@ -128,7 +130,7 @@ protected:
QVBoxLayout* layout8;
QHBoxLayout* layout7;
QSpacerItem* Horizontal_Spacing2;
QVBoxLayout* layout17;
QVBoxLayout* layout19;
QGridLayout* groupBox1Layout;
QVBoxLayout* stunButtonGroupLayout;
QGridLayout* SettingsDTMFLayout;
......@@ -144,7 +146,7 @@ protected:
QHBoxLayout* layout11_2;
QVBoxLayout* layout9;
QVBoxLayout* layout10_2;
QVBoxLayout* layout17_2;
QVBoxLayout* layout17;
QHBoxLayout* layout16;
QSpacerItem* spacer5;
QHBoxLayout* layout16_2;
......
......@@ -28,6 +28,7 @@
#define PROGNAME "SFLPhone"
#define SKINDIR "skins"
#define PIXDIR "pixmaps"
#define RINGDIR "rings"
#define SFLPHONE_LOGO "logo_ico.png"
#define TRAY_ICON "tray-icon.png"
......@@ -44,5 +45,6 @@
#define FORMAT 2 // for 16 bits format
#define OCTETS SAMPLING_RATE * FORMAT // Number of writen
// bytes in buffer
#define YES 0
#define NO 1
#endif // __GLOBAL_H__
......@@ -85,8 +85,8 @@ Manager::Manager (QString *Dc = NULL) {
gui()->configuration();
}
spkr_volume = 10;
mic_volume = 10;
spkr_volume = 100;
mic_volume = 100;
}
Manager::~Manager (void) {
......@@ -185,7 +185,8 @@ Manager::ring (bool var) {
if (this->b_ringing != var) {
this->b_ringing = var;
}
// TODO: play file.wav
tonezone = ringing();
tone->playRing ((gui()->getRingFile()).ascii());
}
// When IP-phone user makes call
......@@ -480,7 +481,7 @@ Manager::setChoose (bool b, bool b2) {
bool
Manager::useStun () {
if (Config::getb("Signalisations", "STUN.useStunYes")) {
if (Config::geti("Signalisations", "STUN.useStun") == YES) {
return true;
} else {
return false;
......
/****************************************************************************
** Form implementation generated from reading ui file 'phonebook.ui'
**
** Created: Fri Jan 28 18:58:54 2005
** Created: Mon Jan 31 18:13:29 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......
/****************************************************************************
** Form interface generated from reading ui file 'phonebook.ui'
**
** Created: Fri Jan 28 18:58:54 2005
** Created: Mon Jan 31 18:13:29 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......
......@@ -121,6 +121,8 @@ QtGUIMainWindow::QtGUIMainWindow (QWidget *parent, const char *name, WFlags f,
this->pt = new Point(skinfilename.ascii());
// Initialisations
this->initSpkrVolumePosition();
this->initMicVolumePosition();
this->initButtons();
this->initBlinkTimer();
......@@ -276,18 +278,12 @@ QtGUIMainWindow::QtGUIMainWindow (QWidget *parent, const char *name, WFlags f,
NULL, mypop, parent, name);
trayicon->show();
connect(trayicon, SIGNAL(clickedLeft()), this, SLOT(clickHandle()));
connect(vol_spkr, SIGNAL(setVolumeValue(int)), this, SLOT(volumeSpkrChanged(int)));
connect(vol_mic, SIGNAL(setVolumeValue(int)), this, SLOT(volumeMicChanged(int)));
}
void
QtGUIMainWindow::volumeSpkrChanged(int val) {
callmanager->spkrSoundVolume(val);
}
void
QtGUIMainWindow::volumeMicChanged(int val) {
callmanager->micSoundVolume(val);
// Connections for volume control
connect(vol_spkr, SIGNAL(setVolumeValue(int)), this,
SLOT(volumeSpkrChanged(int)));
connect(vol_mic, SIGNAL(setVolumeValue(int)), this,
SLOT(volumeMicChanged(int)));
}
/**
......@@ -350,6 +346,46 @@ QtGUIMainWindow::setPathSkin (void) {
"Preferences", "Themes.skinChoice", "metal"));
}
QString
QtGUIMainWindow::ringFile(void) {
return QString(Config::getchar(
"Audio", "Rings.ringChoice", "konga.ul"));
}
QString
QtGUIMainWindow::getRingFile (void) {
QString ringFilename(Skin::getPathRing(QString(RINGDIR), ringFile()));
return ringFilename;
}
void
QtGUIMainWindow::initSpkrVolumePosition (void) {
if (pt->getDirection(VOL_SPKR) == VERTICAL) {
vol_spkr_x = Config::get("Audio", "Volume.speakers_x",
pt->getX(VOL_SPKR));
vol_spkr_y = Config::get("Audio", "Volume.speakers_y",
pt->getVariation(VOL_SPKR));
} else if (pt->getDirection(VOL_SPKR) == HORIZONTAL) {
vol_spkr_x = Config::get("Audio", "Volume.speakers_x",
pt->getX(VOL_SPKR) + pt->getVariation(VOL_SPKR));
vol_spkr_y = Config::get("Audio", "Volume.speakers_y",
pt->getY(VOL_SPKR));
}
}
void
QtGUIMainWindow::initMicVolumePosition (void) {
if (pt->getDirection(VOL_MIC) == VERTICAL) {
vol_mic_x = Config::get("Audio", "Volume.micro_x", pt->getX(VOL_MIC));
vol_mic_y = Config::get("Audio", "Volume.micro_y",
pt->getVariation(VOL_MIC));
} else if (pt->getDirection(VOL_MIC) == HORIZONTAL) {
vol_mic_x = Config::get("Audio", "Volume.micro_x",
pt->getX(VOL_MIC) + pt->getVariation(VOL_MIC));
vol_mic_y = Config::get("Audio", "Volume.micro_y", pt->getY(VOL_MIC));
}
}
/**
* Inits all phonekey buttons.
* Create new QPushButtons, set up tool tip, disable focus, set button geometry
......@@ -413,8 +449,8 @@ QtGUIMainWindow::initButtons (void) {
vol_mic = new VolumeControl(this, NULL, VOLUME, micVolVector);
vol_spkr = new VolumeControl(this, NULL, VOLUME, spkrVolVector);
vol_mic->move(pt->getX(VOL_MIC), pt->getY(VOL_MIC));
vol_spkr->move(pt->getX(VOL_SPKR), pt->getY(VOL_SPKR));
vol_mic->move(vol_mic_x, vol_mic_y);
vol_spkr->move(vol_spkr_x, vol_spkr_y);
}
/**
......@@ -750,6 +786,16 @@ QtGUIMainWindow::startCallTimer (int line) {
///////////////////////////////////////////////////////////////////////////////
// Public slot implementations //
///////////////////////////////////////////////////////////////////////////////
void
QtGUIMainWindow::volumeSpkrChanged(int val) {
callmanager->spkrSoundVolume(val);
}
void
QtGUIMainWindow::volumeMicChanged(int val) {
callmanager->micSoundVolume(val);
}
/**
* Slot to blink with free and busy pixmaps when line is hold.
*/
......@@ -968,6 +1014,21 @@ QtGUIMainWindow::quitApplication (void) {
// Show QMessageBox
confirm = Config::get("Preferences", "Options.confirmQuit", (int)true);
// Save volume positions
// TODO: save position if direction is horizontal
Config::set("Audio", "Volume.speakers_x", pt->getX(VOL_SPKR));
if (vol_spkr->getValue() != micVolVector->Y() - micVolVector->Variation()){
Config::set("Audio", "Volume.speakers_y", pt->getY(VOL_SPKR) -
vol_spkr->getValue());
}
Config::set("Audio", "Volume.micro_x", pt->getX(VOL_MIC));
if (vol_mic->getValue() != spkrVolVector->Y() - spkrVolVector->Variation()){
Config::set("Audio", "Volume.micro_y", pt->getY(VOL_MIC) -
vol_mic->getValue());
}
save();
if (confirm) {
if (QMessageBox::question(this, "Confirm quit",
"Are you sure you want to quit SFLPhone ?",
......@@ -1035,7 +1096,7 @@ QtGUIMainWindow::pressedKeySlot (int id) {
key->startTone(code);
key->generateDTMF(buf, SAMPLING_RATE);
callmanager->audiodriver->audio_buf.resize(SAMPLING_RATE);
callmanager->audiodriver->audio_buf.setData (buf, callmanager->getSpkrVolume()/10);
callmanager->audiodriver->audio_buf.setData (buf, callmanager->getSpkrVolume());
pulselen = Config::get("Signalisations", "DTMF.pulseLength", 250);
callmanager->audiodriver->audio_buf.resize(pulselen * (OCTETS/1000));
// a = callmanager->audiodriver->writeBuffer(buf, pulselen * (OCTETS/1000));
......
......@@ -130,6 +130,8 @@ public:
void toggleLine (int);
void stopTimerMessage (void);
static QString setPathSkin(void);
static QString ringFile (void);
QString getRingFile (void);
inline
void ring (bool b) { this->ringVar = b; }
inline
......@@ -194,6 +196,8 @@ private:
Point *pt;
Vector *micVolVector;
Vector *spkrVolVector;
int vol_mic_x, vol_mic_y;
int vol_spkr_x, vol_spkr_y;
// To construct ring rect pixmap
QImage imageRing;
......@@ -220,6 +224,8 @@ private:
void initButtons (void);
void initBlinkTimer (void);
void initSpkrVolumePosition (void);
void initMicVolumePosition (void);
int numLineBusy (void);
......
......@@ -71,4 +71,9 @@ Skin::getPathPixmap (const QString & pixdir, const QString & filename) {
return (QString(PROGSHAREDIR) + "/" + pixdir + "/" + filename);
}
QString
Skin::getPathRing (const QString & ringdir, const QString & filename) {
return (QString(PROGSHAREDIR) + "/" + ringdir + "/" + filename);
}
// EOF
......@@ -109,6 +109,7 @@ public:
static QString getPath(const QString &,const QString &, const QString &);
static QString getPath(const QString &);
static QString getPathPixmap (const QString &, const QString &);
static QString getPathRing (const QString &, const QString &);
};
#endif // __SKIN_H__
......@@ -18,15 +18,20 @@
*/
#include <math.h>
#include <iostream>
#include <fstream>
#include <qapplication.h>
#include <qstring.h>
#include "audiocodec.h"
#include "configuration.h"
#include "global.h"
#include "manager.h"
#include "tonegenerator.h"
using namespace std;
///////////////////////////////////////////////////////////////////////////////
// ToneThread implementation
......@@ -44,7 +49,7 @@ ToneThread::~ToneThread (void) {
void
ToneThread::run (void) {
while (mngr->tonezone) {
mngr->audiodriver->audio_buf.setData (buf, mngr->getSpkrVolume()/10);
mngr->audiodriver->audio_buf.setData (buf, mngr->getSpkrVolume());
mngr->audiodriver->writeBuffer();
//mngr->audiodriver->writeBuffer(buf, totalbytes);
}
......@@ -232,12 +237,10 @@ ToneGenerator::toneHandle (int idr) {
if (tonethread == NULL) {
tonethread = new ToneThread (manager, buf, totalbytes);
manager->audiodriver->audio_buf.resize(totalbytes);
// manager->audiodriver->audio_buf.setData (buf);
tonethread->start();
}
if (!manager->tonezone) {
//tonethread->join();
if (tonethread != NULL) {
delete tonethread;
tonethread = NULL;
......@@ -247,3 +250,54 @@ ToneGenerator::toneHandle (int idr) {
}
int
ToneGenerator::playRing (const char *fileName) {
short* dst = NULL;
char* src = NULL;
int expandedsize, length;
if (fileName == NULL) {
return 0;
}
fstream file;
file.open(fileName, fstream::in);
if (!file.is_open()) {
return 0;
}
// get length of file:
file.seekg (0, ios::end);
length = file.tellg();
file.seekg (0, ios::beg);
// allocate memory:
src = new char [length];
dst = new short[length];
// read data as a block:
file.read (src,length);
expandedsize = AudioCodec::codecDecode (
PAYLOAD_CODEC_ULAW,
dst,
(unsigned char*)src,
length);
if (tonethread == NULL) {
tonethread = new ToneThread (manager, dst, expandedsize);
manager->audiodriver->audio_buf.resize(expandedsize);
tonethread->start();
}
if (!manager->tonezone) {
if (tonethread != NULL) {
delete tonethread;
tonethread = NULL;
}
}
file.close();
delete[] dst;
delete[] src;
return 1;
}
......@@ -73,6 +73,7 @@ public:
void generateSin (int, int, int, int, short *);
void buildTone (int, int, int, int, short*);
void toneHandle (int);
int playRing (const char*);
short *sample;
int freq1,
......
/****************************************************************************
** Form implementation generated from reading ui file 'url_input.ui'
**
** Created: Fri Jan 28 18:58:54 2005
** Created: Mon Jan 31 18:13:29 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......
/****************************************************************************
** Form interface generated from reading ui file 'url_input.ui'
**
** Created: Fri Jan 28 18:58:54 2005
** Created: Mon Jan 31 18:13:29 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......
......@@ -69,6 +69,8 @@ VolumeControl::mouseMoveEvent (QMouseEvent *e) {
QPoint ptref(e->globalX() - offset(HORIZONTAL), e->globalY() - mouse_y);
if (ptref.x() >= vect->X() and ptref.x() <= vect->Variation()) {
volumeValue = vect->X() - ptref.x();
// Emit a signal
emit setVolumeValue (volumeValue);
move (QPoint(ptref.x(), vect->Y()));
}
}
......@@ -80,4 +82,3 @@ VolumeControl::mousePressEvent (QMouseEvent *e) {
mouse_y = e->y();
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment